Index: branches/wmf-deployment/includes/OutputPage.php |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | * Add the core scripts that are included on every page, for later output into the header |
173 | 173 | */ |
174 | 174 | function addCoreScripts2Top(){ |
175 | | - global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system; |
| 175 | + global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgStylePath, $wgEnableJS2system; |
176 | 176 | // @todo We should deprecate wikibits in favor of mv_embed and jQuery |
177 | 177 | |
178 | 178 | if( $wgEnableJS2system ){ |
— | — | @@ -186,7 +186,16 @@ |
187 | 187 | $so = ''; |
188 | 188 | foreach( $core_classes as $s ){ |
189 | 189 | 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() ); |
191 | 200 | } |
192 | 201 | } |
193 | 202 | $this->mScripts = $so . $this->mScripts; |