r87711 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87710‎ | r87711 | r87712 >
Date:13:10, 9 May 2011
Author:catrope
Status:reverted (Comments)
Tags:
Comment:
(bug 28840) Commit patch by bawolff that encodes dots in ResourceLoader module names as exclamation marks in the generated URLs, so as to avoid triggering the recently added IE security measure and causing a blank 403 response. This broke RL in various ways for IE users.

This is by no means intended to be permanent, but it's the best way to unbreak RL for IE users while we work out how to fix this properly.
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /trunk/phase3/includes/resourceloader/ResourceLoaderContext.php (modified) (history)
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoader.php
@@ -708,7 +708,8 @@
709709 * Convert an array of module names to a packed query string.
710710 *
711711 * For example, array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' )
712 - * becomes 'foo.bar,baz|bar.baz,quux'
 712+ * becomes 'foo!bar,baz|bar!baz,quux'
 713+ * The ! is for IE6 being stupid with extensions.
713714 * @param $modules array of module names (strings)
714715 * @return string Packed query string
715716 */
@@ -726,7 +727,8 @@
727728 $p = $prefix === '' ? '' : $prefix . '.';
728729 $arr[] = $p . implode( ',', $suffixes );
729730 }
730 - return implode( '|', $arr );
 731+ $str = implode( '|', $arr );
 732+ return str_replace( ".", "!", $str ); # bug 28840
731733 }
732734
733735 /**
Index: trunk/phase3/includes/resourceloader/ResourceLoaderContext.php
@@ -67,12 +67,13 @@
6868 /**
6969 * Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to
7070 * an array of module names like array( 'jquery.foo', 'jquery.bar',
71 - * 'jquery.ui.baz', 'jquery.ui.quux' )
 71+ * 'jquery.ui.baz', 'jquery.ui.quux' ) Also translating ! to .
7272 * @param $modules String Packed module name list
7373 * @return array of module names
7474 */
7575 public static function expandModuleNames( $modules ) {
7676 $retval = array();
 77+ $modules = str_replace( "!", ".", $modules ); # bug 28840 - IE is stupid.
7778 $exploded = explode( '|', $modules );
7879 foreach ( $exploded as $group ) {
7980 if ( strpos( $group, ',' ) === false ) {
Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -874,7 +874,7 @@
875875 var p = prefix === '' ? '' : prefix + '.';
876876 arr.push( p + moduleMap[prefix].join( ',' ) );
877877 }
878 - return arr.join( '|' );
 878+ return arr.join( '|' ).replace( /\./g, '!' );
879879 }
880880
881881

Follow-up revisions

RevisionCommit summaryAuthorDate
r877121.17wmf1: Merge r87711 by hand. Because of recent changes in trunk, not a sin...catrope13:20, 9 May 2011
r88034Followup r87711: add ! to the forbidden characters list for module names, per CRcatrope09:24, 14 May 2011
r88883(bug 28840) URLs with dots break because of IE6 security check...catrope09:49, 26 May 2011
r89397(bug 28840) If the query string hits bug 28235, redirect to a safer URL inste...tstarling05:32, 3 June 2011
r89627MFT r89397, r89558, etc.: bug 28840 IE URL extensiontstarling05:57, 7 June 2011
r89628Merge r89627 from 1.18, equivalent to trunk r89558, r89397, etc.: bug 28840 I...tstarling07:00, 7 June 2011
r896761.17: MFT r82247, r87203, r87265, r87494, r87497, r87711, r87840, r88076, r89615catrope19:09, 7 June 2011
r897271.17: Back out r87711 per CR on r89676catrope12:09, 8 June 2011
r91440* Merged r89628 from 1.17: bug 28840 IE URL extension fixes....tstarling06:35, 5 July 2011

Comments

#Comment by Krinkle (talk | contribs)   08:32, 14 May 2011

So, ! is a forbidden character now, which would join the list: comma, pipe, dot. Right ?

Should

Status & tagging log