Special:AllMessages: Ignore case of first letter when sorting
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 24 Jan 2015 10:03:59 +0000 (11:03 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 24 Jan 2015 10:04:42 +0000 (11:04 +0100)
When a message key is defined with a upper case letter the sorting in
Special:AllMessages gets confused, because the upper case letter is
sorted before the lower case letters. Doing the upper case first, than
sorting avoids this when having such a key.

Bug: T86139
Change-Id: I8e9f7ca276a2fa999d8bd41c948cc083964ec66d

includes/specials/SpecialAllMessages.php

index 7cf94cc..0008b10 100644 (file)
@@ -224,15 +224,16 @@ class AllMessagesTablePager extends TablePager {
 
        function getAllMessages( $descending ) {
                $messageNames = Language::getLocalisationCache()->getSubitemList( 'en', 'messages' );
+
+               // Normalise message names so they look like page titles and sort correctly - T86139
+               $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
+
                if ( $descending ) {
                        rsort( $messageNames );
                } else {
                        asort( $messageNames );
                }
 
-               // Normalise message names so they look like page titles
-               $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
-
                return $messageNames;
        }