From: umherirrender Date: Wed, 1 Aug 2012 17:40:10 +0000 (+0200) Subject: Change File::compare to use getName, not getTitle X-Git-Tag: 1.31.0-rc.0~22888^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=7b2a62b74a611cfb74aa9909ddb4f6aa840040e8;p=lhc%2Fweb%2Fwiklou.git Change File::compare to use getName, not getTitle 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 --- diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 3fa81663b6..7489862ee3 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -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() ); } /**