(bug 21535) Add 'namespace' to cache key for RecentChanges RSS feed. Patch by crb, reviewed by Rowan.

This commit is contained in:
Happy-melon 2009-12-17 15:42:17 +00:00
parent eb8b230abc
commit b4b5eeb2c6
3 changed files with 6 additions and 5 deletions

View file

@ -72,6 +72,7 @@ following names for their contribution to the product.
* Brent G
* Brianna Laugher
* Carlin
* Crb
* Dan Nessett
* Daniel Arnold
* Denny Vrandecic

View 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);

View 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 );
}