From: Aaron Schulz Date: Fri, 16 May 2008 20:21:20 +0000 (+0000) Subject: Let getThumbnails() work for non-hashed dirs (bug 13788) X-Git-Tag: 1.31.0-rc.0~47591 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=3418add517f3a787e460e8353ac0f575d9d36ebd;p=lhc%2Fweb%2Fwiklou.git Let getThumbnails() work for non-hashed dirs (bug 13788) --- 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;