* Fix CSS media declaration for "screen, projection"; was causing some
validation issues
* (bug 10495) $wgMemcachedDebug set twice in includes/DefaultSettings.php
+* (bug 10316) Prevent inconsistent cached skin settings in gen=js by setting
+ the intended skin directly in the URL.
+
== API changes since 1.10 ==
$r .= "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js?$wgStyleVersion\"></script>\n";
global $wgUseSiteJs;
if ($wgUseSiteJs) {
- if ($wgUser->isLoggedIn()) {
- $r .= "<script type=\"$wgJsMimeType\" src=\"".htmlspecialchars(self::makeUrl('-','action=raw&smaxage=0&gen=js'))."\"><!-- site js --></script>\n";
- } else {
- $r .= "<script type=\"$wgJsMimeType\" src=\"".htmlspecialchars(self::makeUrl('-','action=raw&gen=js'))."\"><!-- site js --></script>\n";
- }
+ $jsCache = $wgUser->isLoggedIn() ? '&smaxage=0' : '';
+ $r .= "<script type=\"$wgJsMimeType\" src=\"".
+ htmlspecialchars(self::makeUrl('-',
+ "action=raw$jsCache&gen=js&useskin=" .
+ urlencode( $this->getSkinName() ) ) ) .
+ "\"><!-- site js --></script>\n";
}
if( $allowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
global $wgStylePath;
$s = "/* generated javascript */\n";
- $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
+ $s .= "var skin = '" . Xml::escapeJsString( $this->getSkinName() ) . "';\n";
+ $s .= "var stylepath = '" . Xml::escapeJsString( $wgStylePath ) . "';";
$s .= "\n\n/* MediaWiki:Common.js */\n";
$commonJs = wfMsgForContent('common.js');
if ( !wfEmptyMsg ( 'common.js', $commonJs ) ) {
$tpl->setRef( 'userjsprev', $this->userjsprev);
global $wgUseSiteJs;
if ($wgUseSiteJs) {
- if($this->loggedin) {
- $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&smaxage=0&gen=js') );
- } else {
- $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&gen=js') );
- }
+ $jsCache = $this->loggedin ? '&smaxage=0' : '';
+ $tpl->set( 'jsvarurl',
+ self::makeUrl('-',
+ "action=raw$jsCache&gen=js&useskin=" .
+ urlencode( $this->getSkinName() ) ) );
} else {
$tpl->set('jsvarurl', false);
}