Let getThumbnails() work for non-hashed dirs (bug 13788)
authorAaron Schulz <aaron@users.mediawiki.org>
Fri, 16 May 2008 20:21:20 +0000 (20:21 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Fri, 16 May 2008 20:21:20 +0000 (20:21 +0000)
includes/filerepo/LocalFile.php

index 33de732..d341290 100644 (file)
@@ -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;