r56444 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56443‎ | r56444 | r56445 >
Date:21:31, 16 September 2009
Author:brion
Status:ok
Tags:
Comment:
Fix for wikibits.js loading when $wgStylePath != "$wgScriptPath/skins"
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -171,7 +171,7 @@
172172 * Add the core scripts that are included on every page, for later output into the header
173173 */
174174 function addCoreScripts2Top(){
175 - global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system;
 175+ global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgStylePath, $wgEnableJS2system;
176176 // @todo We should deprecate wikibits in favor of mv_embed and jQuery
177177
178178 if( $wgEnableJS2system ){
@@ -186,7 +186,16 @@
187187 $so = '';
188188 foreach( $core_classes as $s ){
189189 if( isset( $wgJSAutoloadLocalClasses[$s] ) ){
190 - $so .= Html::linkedScript( "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() );
 190+ $path = $wgJSAutoloadLocalClasses[$s];
 191+ // @fixme this is an awful hack
 192+ if( substr( $path, 0, 4 ) == "http" || substr( $path, 0, 1 ) == '/' ) {
 193+ // Assume a full or local path
 194+ } elseif( substr( $path, 0, 6 ) == "skins/" ) {
 195+ $path = $wgStylePath . substr( $path, 5 );
 196+ } else {
 197+ $path = $wgScriptPath . "/" . $path;
 198+ }
 199+ $so .= Html::linkedScript( $path . "?" . $this->getURIDparam() );
191200 }
192201 }
193202 $this->mScripts = $so . $this->mScripts;

Follow-up revisions

RevisionCommit summaryAuthorDate
r56445merge r56444 wikibits.js fixbrion21:32, 16 September 2009

Status & tagging log