From 6e170eadbab639eddd698dab7f671634a8763447 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Mon, 26 Apr 2010 21:02:30 +0000 Subject: [PATCH] Added $wgLocalStylePath global variable, and solved bug #22858 by using this new variable in the Vector skin for the inclusion of skins/vector/csshover.htc. HTC files are not cross-domain friendly, so in production environments where $wgStylePath is set to point to bits.wikimedia.org, this will throw JavaScript errors on the page. By adding this new global, which is identical to $wgStylePath except that it will not become customized when $wgStylePath is, we can ensure that certain files, if needed, are always loaded from the same domain as the site. --- RELEASE-NOTES | 3 +++ includes/DefaultSettings.php | 1 + includes/Setup.php | 1 + skins/Vector.php | 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 99d8bc0a9c..2d8dfbb774 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -55,6 +55,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 23276) Add hook to Special:NewPages to modify query * Add accesskey 's' and tooltip to 'Save' button at Special:Preferences * (bug 20186) Allow filtering Special:Contributions for RevisionDeleted edits +* (bug 22858) $wgLocalStylePath is by default set to the same value as + $wgStylePath but should never point to a different domain than the site is + on, allowing skins to use .htc files which are not cross-domain friendly. === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 5f20dea095..b5fd2e9fca 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -145,6 +145,7 @@ $wgRedirectScript = false; ///< defaults to "{$wgScriptPath}/redirect{$wgScrip * asset paths as seen by users */ $wgStylePath = false; ///< defaults to "{$wgScriptPath}/skins" +$wgLocalStylePath = false; ///< defaults to the same value as $wgStylePath, and shouldn't point to an external domain $wgExtensionAssetsPath = false; ///< defaults to "{$wgScriptPath}/extensions" /** diff --git a/includes/Setup.php b/includes/Setup.php index b37fb5e0c8..b8ce9be4de 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -39,6 +39,7 @@ if( $wgArticlePath === false ) { } if( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins"; +if( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins"; if( $wgStyleDirectory === false) $wgStyleDirectory = "$IP/skins"; if( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions"; diff --git a/skins/Vector.php b/skins/Vector.php index 4fa5a65a2d..74e346c111 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -26,7 +26,7 @@ class SkinVector extends SkinTemplate { * @param object $out Output page object to initialize */ public function initPage( OutputPage $out ) { - global $wgStylePath; + global $wgLocalStylePath; parent::initPage( $out ); @@ -35,7 +35,7 @@ class SkinVector extends SkinTemplate { // wait for the CSS file to load before fetching the HTC file. $out->addScript( '' ); } -- 2.20.1