Merge "Fix "UTPage" creation in tests"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index e05c8b8..f1a31a5 100644 (file)
  * @ingroup SpecialPage
  */
 class SpecialRecentChanges extends ChangesListSpecialPage {
-
+       // @codingStandardsIgnoreStart Needed "useless" override to change parameters.
        public function __construct( $name = 'Recentchanges', $restriction = '' ) {
                parent::__construct( $name, $restriction );
        }
+       // @codingStandardsIgnoreEnd
 
        /**
         * Main execution point
@@ -44,6 +45,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        $query = $this->getFeedQuery();
                        $query['feedformat'] = $feedFormat === 'atom' ? 'atom' : 'rss';
                        $this->getOutput()->redirect( wfAppendQuery( wfScript( 'api' ), $query ) );
+
                        return;
                }
 
@@ -92,8 +94,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         */
        protected function getCustomFilters() {
                if ( $this->customFilters === null ) {
-                       $this->customFilters = array();
-                       wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ) );
+                       $this->customFilters = parent::getCustomFilters();
+                       wfRunHooks( 'SpecialRecentChangesFilters', array( $this, &$this->customFilters ), '1.23' );
                }
 
                return $this->customFilters;
@@ -228,7 +230,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                );
 
                if ( !wfRunHooks( 'SpecialRecentChangesQuery',
-                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) )
+                       array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ),
+                       '1.23' )
                ) {
                        return false;
                }
@@ -271,6 +274,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                if ( $query['limit'] > $wgFeedLimit ) {
                        $query['limit'] = $wgFeedLimit;
                }
+
                return $query;
        }
 
@@ -285,13 +289,15 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                $limit = $opts['limit'];
 
-               $showWatcherCount = $wgRCShowWatchingUsers && $this->getUser()->getOption( 'shownumberswatching' );
+               $showWatcherCount = $wgRCShowWatchingUsers
+                       && $this->getUser()->getOption( 'shownumberswatching' );
                $watcherCache = array();
 
                $dbr = $this->getDB();
 
                $counter = 1;
                $list = ChangesList::newFromContext( $this->getContext() );
+               $list->initChangesListRows( $rows );
 
                $rclistOutput = $list->beginRecentChangesList();
                foreach ( $rows as $obj ) {
@@ -334,7 +340,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                if ( $rows->numRows() === 0 ) {
                        $this->getOutput()->addHtml(
-                               '<div class="mw-changeslist-empty">' . $this->msg( 'recentchanges-noresult' )->parse() . '</div>'
+                               '<div class="mw-changeslist-empty">' .
+                               $this->msg( 'recentchanges-noresult' )->parse() .
+                               '</div>'
                        );
                } else {
                        $this->getOutput()->addHTML( $rclistOutput );
@@ -488,6 +496,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
        public function checkLastModified() {
                $dbr = $this->getDB();
                $lastmod = $dbr->selectField( 'recentchanges', 'MAX(rc_timestamp)', false, __METHOD__ );
+
                return $lastmod;
        }
 
@@ -688,7 +697,7 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        'hideliu' => 'rcshowhideliu',
                        'hidepatrolled' => 'rcshowhidepatr',
                        'hidemyself' => 'rcshowhidemine'
-                 );
+               );
 
                $showhide = array( 'show', 'hide' );