r65555 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65554‎ | r65555 | r65556 >
Date:21:02, 26 April 2010
Author:tparscal
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Setup.php (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Vector.php
@@ -26,7 +26,7 @@
2727 * @param object $out Output page object to initialize
2828 */
2929 public function initPage( OutputPage $out ) {
30 - global $wgStylePath;
 30+ global $wgLocalStylePath;
3131
3232 parent::initPage( $out );
3333
@@ -35,7 +35,7 @@
3636 // wait for the CSS file to load before fetching the HTC file.
3737 $out->addScript(
3838 '<!--[if lt IE 7]><style type="text/css">body{behavior:url("' .
39 - $wgStylePath .
 39+ $wgLocalStylePath .
4040 '/vector/csshover.htc")}</style><![endif]-->'
4141 );
4242 }
Index: trunk/phase3/includes/Setup.php
@@ -39,6 +39,7 @@
4040 }
4141
4242 if( $wgStylePath === false ) $wgStylePath = "$wgScriptPath/skins";
 43+if( $wgLocalStylePath === false ) $wgLocalStylePath = "$wgScriptPath/skins";
4344 if( $wgStyleDirectory === false) $wgStyleDirectory = "$IP/skins";
4445 if( $wgExtensionAssetsPath === false ) $wgExtensionAssetsPath = "$wgScriptPath/extensions";
4546
Index: trunk/phase3/includes/DefaultSettings.php
@@ -145,6 +145,7 @@
146146 * asset paths as seen by users
147147 */
148148 $wgStylePath = false; ///< defaults to "{$wgScriptPath}/skins"
 149+$wgLocalStylePath = false; ///< defaults to the same value as $wgStylePath, and shouldn't point to an external domain
149150 $wgExtensionAssetsPath = false; ///< defaults to "{$wgScriptPath}/extensions"
150151
151152 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -55,6 +55,9 @@
5656 * (bug 23276) Add hook to Special:NewPages to modify query
5757 * Add accesskey 's' and tooltip to 'Save' button at Special:Preferences
5858 * (bug 20186) Allow filtering Special:Contributions for RevisionDeleted edits
 59+* (bug 22858) $wgLocalStylePath is by default set to the same value as
 60+ $wgStylePath but should never point to a different domain than the site is
 61+ on, allowing skins to use .htc files which are not cross-domain friendly.
5962
6063 === Bug fixes in 1.17 ===
6164 * (bug 17560) Half-broken deletion moved image files to deletion archive

Follow-up revisions

RevisionCommit summaryAuthorDate
r65764Rephrase potentially confusing comment in r65555catrope21:17, 1 May 2010
r65959Merge Vector and UsabilityInitiative fixes from trunk: r64724, r65064, r65379...catrope19:03, 5 May 2010

Status & tagging log