From: Tim Starling Date: Tue, 29 Aug 2006 07:36:02 +0000 (+0000) Subject: Only use the message cache in action=raw if it is explicitly requested. The previous... X-Git-Tag: 1.31.0-rc.0~55887 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=4657da77f42af1172522d43b44c32668fee6a541;p=lhc%2Fweb%2Fwiklou.git Only use the message cache in action=raw if it is explicitly requested. The previous behaviour was counterintuitive unless you're pulling stylesheets or javascript into HTML. It's been the source of many complaints from people trying to use action=raw as an API. --- diff --git a/includes/RawPage.php b/includes/RawPage.php index 3c6cff7525..f72c660dd1 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -37,6 +37,7 @@ class RawPage { $smaxage = $this->mRequest->getIntOrNull( 'smaxage', $wgSquidMaxage ); $maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage ); $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand'; + $this->mUseMessageCache = $this->mRequest->getBool( 'usemsgcache' ); $oldid = $this->mRequest->getInt( 'oldid' ); switch ( $wgRequest->getText( 'direction' ) ) { @@ -152,7 +153,7 @@ class RawPage { $text = ''; if( $this->mTitle ) { // If it's a MediaWiki message we can just hit the message cache - if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI && !$this->mOldId ) { + if ( $this->mUseMessageCache && $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { $key = $this->mTitle->getDBkey(); $text = wfMsgForContentNoTrans( $key ); # If the message doesn't exist, return a blank diff --git a/includes/Skin.php b/includes/Skin.php index 2d75ef5ab9..e82dcb40ca 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -365,7 +365,7 @@ class Skin extends Linker { $s = "@import \"$wgStylePath/$sheet\";\n"; if($wgContLang->isRTL()) $s .= "@import \"$wgStylePath/common/common_rtl.css\";\n"; - $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; + $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; $s .= '@import "' . $this->makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) . "\";\n" . '@import "'.$this->makeNSUrl( ucfirst( $this->getSkinName() . '.css' ), $query, NS_MEDIAWIKI ) . "\";\n"; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 3f0c7b34d2..f6ee35657c 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -932,7 +932,7 @@ class SkinTemplate extends Skin { # If we use the site's dynamic CSS, throw that in, too if ( $wgUseSiteCss ) { - $query = "action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; + $query = "usemsgcache=yes&action=raw&ctype=text/css&smaxage=$wgSquidMaxage"; $sitecss .= '@import "' . $this->makeNSUrl('Common.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . $this->makeNSUrl(ucfirst($this->skinname) . '.css', $query, NS_MEDIAWIKI) . '";' . "\n"; $sitecss .= '@import "' . $this->makeUrl('-','action=raw&gen=css' . $siteargs) . '";' . "\n";