(bug 21535) Add 'namespace' to cache key for RecentChanges RSS feed. Patch by crb...
authorHappy-melon <happy-melon@users.mediawiki.org>
Thu, 17 Dec 2009 15:42:17 +0000 (15:42 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Thu, 17 Dec 2009 15:42:17 +0000 (15:42 +0000)
CREDITS
includes/ChangesFeed.php
includes/specials/SpecialRecentchanges.php

diff --git a/CREDITS b/CREDITS
index 1b2f46f..4d4f360 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -72,6 +72,7 @@ following names for their contribution to the product.
 * Brent G
 * Brianna Laugher
 * Carlin
+* Crb
 * Dan Nessett
 * Daniel Arnold
 * Denny Vrandecic
index 2058868..54fb556 100644 (file)
@@ -18,7 +18,7 @@ class ChangesFeed {
                        $feedTitle, htmlspecialchars( $description ), $wgTitle->getFullUrl() );
        }
 
-       public function execute( $feed, $rows, $limit=0, $hideminor=false, $lastmod=false, $target='' ) {
+       public function execute( $feed, $rows, $limit=0, $hideminor=false, $namespace='', $lastmod=false, $target='' ) {
                global $messageMemc, $wgFeedCacheTimeout;
                global $wgSitename, $wgLang;
 
@@ -27,7 +27,7 @@ class ChangesFeed {
                }
 
                $timekey = wfMemcKey( $this->type, $this->format, 'timestamp' );
-               $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $target, $wgLang->getCode() );
+               $key = wfMemcKey( $this->type, $this->format, $limit, $hideminor, $namespace, $target, $wgLang->getCode() );
 
                FeedUtils::checkPurge($timekey, $key);
 
index 1d38e57..1642132 100644 (file)
@@ -67,8 +67,8 @@ class SpecialRecentChanges extends SpecialPage {
        public function feedSetup() {
                global $wgFeedLimit, $wgRequest;
                $opts = $this->getDefaultOptions();
-               # Feed is cached on limit,hideminor; other params would randomly not work
-               $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor' ) );
+               # Feed is cached on limit,hideminor,namespace; other params would randomly not work
+               $opts->fetchValuesFromRequest( $wgRequest, array( 'limit', 'hideminor', 'namespace' ) );
                $opts->validateIntBounds( 'limit', 0, $wgFeedLimit );
                return $opts;
        }
@@ -117,7 +117,7 @@ class SpecialRecentChanges extends SpecialPage {
                $target = isset($opts['target']) ? $opts['target'] : ''; // RCL has targets
                if( $feedFormat ) {
                        list( $feed, $feedObj ) = $this->getFeedObject( $feedFormat );
-                       $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $lastmod, $target );
+                       $feed->execute( $feedObj, $rows, $opts['limit'], $opts['hideminor'], $opts['namespace'], $lastmod, $target );
                } else {
                        $this->webOutput( $rows, $opts );
                }