From: Brion Vibber Date: Wed, 7 Oct 2009 17:40:56 +0000 (+0000) Subject: Merge r57468 fix from wmf-deployment... fixes $wgStylePath in default script loader... X-Git-Tag: 1.31.0-rc.0~39359 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=0b031afc99e81df0ee86c68ea0b7255228957378;p=lhc%2Fweb%2Fwiklou.git Merge r57468 fix from wmf-deployment... fixes $wgStylePath in default script loader... again... DO NOT ASSUME THAT /skins IS ALWAYS THE SAME AS $wgStylePath --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 844496c1f7..79f1dbd792 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -206,7 +206,7 @@ class OutputPage { */ function addScriptClass( $js_class ){ global $wgDebugJavaScript, $wgJSAutoloadLocalClasses, $wgJSAutoloadClasses, - $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath, $wgEnableJS2system; + $wgEnableScriptLoader, $wgStyleVersion, $wgScriptPath, $wgStylePath, $wgEnableJS2system; $path = jsScriptLoader::getJsPathFromClass( $js_class ); if( $path !== false ){ @@ -217,7 +217,15 @@ class OutputPage { } } else { // Source the script directly - $path = $wgScriptPath . '/' . $path; + $prefix = "skins/common/"; + if( substr( $path, 0, 1 ) == '/' ) { + // straight path + } elseif( substr( $path, 0, strlen( $prefix ) ) == $prefix ) { + // Respect $wgStypePath + $path = "{$wgStylePath}/common/" . substr( $path, strlen( $prefix ) ); + } else { + $path = $wgScriptPath . '/' . $path; + } $urlAppend = ( $wgDebugJavaScript ) ? time() : $this->getURIDparam( $js_class ); $this->addScript( Html::linkedScript( "$path?$urlAppend" ) );