Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -285,11 +285,11 @@ |
286 | 286 | $tpl->setRef( 'userjsprev', $this->userjsprev); |
287 | 287 | global $wgUseSiteJs; |
288 | 288 | if ($wgUseSiteJs) { |
289 | | - if($this->loggedin) { |
290 | | - $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&smaxage=0&gen=js') ); |
291 | | - } else { |
292 | | - $tpl->set( 'jsvarurl', self::makeUrl('-','action=raw&gen=js') ); |
293 | | - } |
| 289 | + $jsCache = $this->loggedin ? '&smaxage=0' : ''; |
| 290 | + $tpl->set( 'jsvarurl', |
| 291 | + self::makeUrl('-', |
| 292 | + "action=raw$jsCache&gen=js&useskin=" . |
| 293 | + urlencode( $this->getSkinName() ) ) ); |
294 | 294 | } else { |
295 | 295 | $tpl->set('jsvarurl', false); |
296 | 296 | } |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -354,11 +354,12 @@ |
355 | 355 | $r .= "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js?$wgStyleVersion\"></script>\n"; |
356 | 356 | global $wgUseSiteJs; |
357 | 357 | if ($wgUseSiteJs) { |
358 | | - if ($wgUser->isLoggedIn()) { |
359 | | - $r .= "<script type=\"$wgJsMimeType\" src=\"".htmlspecialchars(self::makeUrl('-','action=raw&smaxage=0&gen=js'))."\"><!-- site js --></script>\n"; |
360 | | - } else { |
361 | | - $r .= "<script type=\"$wgJsMimeType\" src=\"".htmlspecialchars(self::makeUrl('-','action=raw&gen=js'))."\"><!-- site js --></script>\n"; |
362 | | - } |
| 358 | + $jsCache = $wgUser->isLoggedIn() ? '&smaxage=0' : ''; |
| 359 | + $r .= "<script type=\"$wgJsMimeType\" src=\"". |
| 360 | + htmlspecialchars(self::makeUrl('-', |
| 361 | + "action=raw$jsCache&gen=js&useskin=" . |
| 362 | + urlencode( $this->getSkinName() ) ) ) . |
| 363 | + "\"><!-- site js --></script>\n"; |
363 | 364 | } |
364 | 365 | if( $allowUserJs && $wgUser->isLoggedIn() ) { |
365 | 366 | $userpage = $wgUser->getUserPage(); |
— | — | @@ -427,7 +428,8 @@ |
428 | 429 | |
429 | 430 | global $wgStylePath; |
430 | 431 | $s = "/* generated javascript */\n"; |
431 | | - $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';"; |
| 432 | + $s .= "var skin = '" . Xml::escapeJsString( $this->getSkinName() ) . "';\n"; |
| 433 | + $s .= "var stylepath = '" . Xml::escapeJsString( $wgStylePath ) . "';"; |
432 | 434 | $s .= "\n\n/* MediaWiki:Common.js */\n"; |
433 | 435 | $commonJs = wfMsgForContent('common.js'); |
434 | 436 | if ( !wfEmptyMsg ( 'common.js', $commonJs ) ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -266,7 +266,10 @@ |
267 | 267 | * Fix CSS media declaration for "screen, projection"; was causing some |
268 | 268 | validation issues |
269 | 269 | * (bug 10495) $wgMemcachedDebug set twice in includes/DefaultSettings.php |
| 270 | +* (bug 10316) Prevent inconsistent cached skin settings in gen=js by setting |
| 271 | + the intended skin directly in the URL. |
270 | 272 | |
| 273 | + |
271 | 274 | == API changes since 1.10 == |
272 | 275 | |
273 | 276 | Full API documentation is available at http://www.mediawiki.org/wiki/API |