(bug 32434) API allows reblocking the user without reblock parameter.
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index f542640..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;
        }
@@ -481,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 );
@@ -534,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 );
        }
 
        /**