From: Brion Vibber Date: Wed, 16 Sep 2009 21:31:17 +0000 (+0000) Subject: Fix for wikibits.js loading when $wgStylePath != "$wgScriptPath/skins" X-Git-Tag: 1.31.0-rc.0~39709 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22auteur_infos%22%2C%20%22id_auteur=%24id%22%29%20.%20%22?a=commitdiff_plain;h=0a079c13a14d104719829b4d6b4a8579d50043d2;p=lhc%2Fweb%2Fwiklou.git Fix for wikibits.js loading when $wgStylePath != "$wgScriptPath/skins" --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 3843787c8b..a5da831e5a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -171,7 +171,7 @@ class OutputPage { * Add the core scripts that are included on every page, for later output into the header */ function addCoreScripts2Top(){ - global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system; + global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgStylePath, $wgEnableJS2system; // @todo We should deprecate wikibits in favor of mv_embed and jQuery if( $wgEnableJS2system ){ @@ -186,7 +186,16 @@ class OutputPage { $so = ''; foreach( $core_classes as $s ){ if( isset( $wgJSAutoloadLocalClasses[$s] ) ){ - $so .= Html::linkedScript( "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() ); + $path = $wgJSAutoloadLocalClasses[$s]; + // @fixme this is an awful hack + if( substr( $path, 0, 4 ) == "http" || substr( $path, 0, 1 ) == '/' ) { + // Assume a full or local path + } elseif( substr( $path, 0, 6 ) == "skins/" ) { + $path = $wgStylePath . substr( $path, 5 ); + } else { + $path = $wgScriptPath . "/" . $path; + } + $so .= Html::linkedScript( $path . "?" . $this->getURIDparam() ); } } $this->mScripts = $so . $this->mScripts;