(bug 32434) API allows reblocking the user without reblock parameter.
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index ec8f93b..2984bc7 100644 (file)
@@ -109,8 +109,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        public function feedSetup() {
                global $wgFeedLimit;
                $opts = $this->getDefaultOptions();
-               # Feed is cached on limit,hideminor,namespace; other params would randomly not work
-               $opts->fetchValuesFromRequest( $this->getRequest(), array( 'limit', 'hideminor', 'namespace' ) );
+               $opts->fetchValuesFromRequest( $this->getRequest() );
                $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
                return $opts;
        }
@@ -382,7 +381,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $invert = $opts['invert'];
                $associated = $opts['associated'];
 
-               $fields = array( $dbr->tableName( 'recentchanges' ) . '.*' ); // all rc columns
+               $fields = RecentChange::selectFields();
                // JOIN on watchlist for users
                if ( $uid ) {
                        $tables[] = 'watchlist';
@@ -396,14 +395,15 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $fields[] = 'page_latest';
                        $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
                }
-               if ( !$this->including() ) {
-                       // Tag stuff.
-                       // Doesn't work when transcluding. See bug 23293
-                       ChangeTags::modifyDisplayQuery(
-                               $tables, $fields, $conds, $join_conds, $query_options,
-                               $opts['tagfilter']
-                       );
-               }
+               // Tag stuff.
+               ChangeTags::modifyDisplayQuery(
+                       $tables,
+                       $fields,
+                       $conds,
+                       $join_conds,
+                       $query_options,
+                       $opts['tagfilter']
+               );
 
                if ( !wfRunHooks( 'SpecialRecentChangesQuery',
                        array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$fields ) ) )
@@ -480,7 +480,12 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                // And now for the content
-               $this->getOutput()->setFeedAppendQuery( $this->getFeedQuery() );
+               $feedQuery = $this->getFeedQuery();
+               if ( $feedQuery !== '' ) {
+                       $this->getOutput()->setFeedAppendQuery( $feedQuery );
+               } else {
+                       $this->getOutput()->setFeedAppendQuery( false );
+               }
 
                if( $wgAllowCategorizedRecentChanges ) {
                        $this->filterByCategories( $rows, $opts );
@@ -533,11 +538,24 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
        /**
         * Get the query string to append to feed link URLs.
-        * This is overridden by RCL to add the target parameter
-        * @return bool
+        * 
+        * @return string
         */
        public function getFeedQuery() {
-               return false;
+               global $wgFeedLimit;
+
+               $this->getOptions()->validateIntBounds( 'limit', 0, $wgFeedLimit );
+               $options = $this->getOptions()->getChangedValues();
+
+               // wfArrayToCgi() omits options set to null or false
+               foreach ( $options as &$value ) {
+                       if ( $value === false ) {
+                               $value = '0';
+                       }
+               }
+               unset( $value );
+
+               return wfArrayToCgi( $options );
        }
 
        /**