From: umherirrender Date: Sat, 24 Jan 2015 10:03:59 +0000 (+0100) Subject: Special:AllMessages: Ignore case of first letter when sorting X-Git-Tag: 1.31.0-rc.0~12582^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=227205f6d5ce8ce0b80866c37a387f5d07812192;p=lhc%2Fweb%2Fwiklou.git Special:AllMessages: Ignore case of first letter when sorting 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 --- diff --git a/includes/specials/SpecialAllMessages.php b/includes/specials/SpecialAllMessages.php index 7cf94cccc4..0008b100c1 100644 --- a/includes/specials/SpecialAllMessages.php +++ b/includes/specials/SpecialAllMessages.php @@ -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; }