From: Happy-melon Date: Thu, 17 Dec 2009 15:42:17 +0000 (+0000) Subject: (bug 21535) Add 'namespace' to cache key for RecentChanges RSS feed. Patch by crb... X-Git-Tag: 1.31.0-rc.0~38514 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=b4b5eeb2c65db54b3463f92f071d1e3cc220c12c;p=lhc%2Fweb%2Fwiklou.git (bug 21535) Add 'namespace' to cache key for RecentChanges RSS feed. Patch by crb, reviewed by Rowan. --- diff --git a/CREDITS b/CREDITS index 1b2f46faa6..4d4f360070 100644 --- 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 diff --git a/includes/ChangesFeed.php b/includes/ChangesFeed.php index 2058868d27..54fb556001 100644 --- a/includes/ChangesFeed.php +++ b/includes/ChangesFeed.php @@ -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); diff --git a/includes/specials/SpecialRecentchanges.php b/includes/specials/SpecialRecentchanges.php index 1d38e57d2b..1642132618 100644 --- a/includes/specials/SpecialRecentchanges.php +++ b/includes/specials/SpecialRecentchanges.php @@ -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 ); }