Merge "Do not call purgeExpiredRestrictions on simple page views"
[lhc/web/wiklou.git] / includes / specials / SpecialAllMessages.php
index 760b41b..0008b10 100644 (file)
@@ -101,7 +101,8 @@ class AllMessagesTablePager extends TablePager {
                $this->mIndexField = 'am_title';
                $this->mPage = $page;
                $this->mConds = $conds;
-               $this->mDefaultDirection = IndexPager::DIR_ASCENDING;
+               // FIXME: Why does this need to be set to DIR_DESCENDING to produce ascending ordering?
+               $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
                $this->mLimitsShown = array( 20, 50, 100, 250, 500, 5000 );
 
                global $wgContLang;
@@ -222,19 +223,17 @@ class AllMessagesTablePager extends TablePager {
        }
 
        function getAllMessages( $descending ) {
-               wfProfileIn( __METHOD__ );
                $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 );
-
-               wfProfileOut( __METHOD__ );
-
                return $messageNames;
        }
 
@@ -251,7 +250,6 @@ class AllMessagesTablePager extends TablePager {
         */
        public static function getCustomisedStatuses( $messageNames, $langcode = 'en', $foreign = false ) {
                // FIXME: This function should be moved to Language:: or something.
-               wfProfileIn( __METHOD__ . '-db' );
 
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'page',
@@ -287,8 +285,6 @@ class AllMessagesTablePager extends TablePager {
                        }
                }
 
-               wfProfileOut( __METHOD__ . '-db' );
-
                return array( 'pages' => $pageFlags, 'talks' => $talkFlags );
        }