Change File::compare to use getName, not getTitle
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 1 Aug 2012 17:40:10 +0000 (19:40 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Wed, 1 Aug 2012 17:40:10 +0000 (19:40 +0200)
For files the file name with underscores is often used,
than the compare method should do that also.
This matches than the ORDER BY img_name done by some query.

Change-Id: Ia1b89577538bdfdf751c7b9584e7c008a8c2bb1e

includes/filerepo/file/File.php

index 3fa8166..7489862 100644 (file)
@@ -246,15 +246,15 @@ abstract class File {
        }
 
        /**
-        * Callback for usort() to do file sorts by title
+        * Callback for usort() to do file sorts by name
         *
         * @param $a File
         * @param $b File
         *
-        * @return Integer: result of title comparison
+        * @return Integer: result of name comparison
         */
        public static function compare( File $a, File $b ) {
-               return Title::compare( $a->getTitle(), $b->getTitle() );
+               return strcmp( $a->getName(), $b->getName() );
        }
 
        /**