From 3418add517f3a787e460e8353ac0f575d9d36ebd Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 16 May 2008 20:21:20 +0000 Subject: [PATCH] Let getThumbnails() work for non-hashed dirs (bug 13788) --- includes/filerepo/LocalFile.php | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 33de7322dd..d341290bad 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -518,25 +518,21 @@ class LocalFile extends File * Get all thumbnail names previously generated for this file */ function getThumbnails() { - if ( $this->isHashed() ) { - $this->load(); - $files = array(); - $dir = $this->getThumbPath(); - - if ( is_dir( $dir ) ) { - $handle = opendir( $dir ); - - if ( $handle ) { - while ( false !== ( $file = readdir($handle) ) ) { - if ( $file{0} != '.' ) { - $files[] = $file; - } + $this->load(); + $files = array(); + $dir = $this->getThumbPath(); + + if ( is_dir( $dir ) ) { + $handle = opendir( $dir ); + + if ( $handle ) { + while ( false !== ( $file = readdir($handle) ) ) { + if ( $file{0} != '.' ) { + $files[] = $file; } - closedir( $handle ); } + closedir( $handle ); } - } else { - $files = array(); } return $files; -- 2.20.1