(bug 28840) Commit patch by bawolff that encodes dots in ResourceLoader module names...
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 9 May 2011 13:10:06 +0000 (13:10 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 9 May 2011 13:10:06 +0000 (13:10 +0000)
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.

includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderContext.php
resources/mediawiki/mediawiki.js

index 3afe69c..7e8d099 100644 (file)
@@ -708,7 +708,8 @@ class ResourceLoader {
         * Convert an array of module names to a packed query string.
         * 
         * For example, array( 'foo.bar', 'foo.baz', 'bar.baz', 'bar.quux' )
-        * becomes 'foo.bar,baz|bar.baz,quux'
+        * becomes 'foo!bar,baz|bar!baz,quux'
+        * The ! is for IE6 being stupid with extensions.
         * @param $modules array of module names (strings)
         * @return string Packed query string
         */
@@ -726,7 +727,8 @@ class ResourceLoader {
                        $p = $prefix === '' ? '' : $prefix . '.';
                        $arr[] = $p . implode( ',', $suffixes );
                }
-               return implode( '|', $arr );
+               $str = implode( '|', $arr );
+               return str_replace( ".", "!", $str ); # bug 28840
        }
        
        /**
index 5600304..581f971 100644 (file)
@@ -67,12 +67,13 @@ class ResourceLoaderContext {
        /**
         * Expand a string of the form jquery.foo,bar|jquery.ui.baz,quux to
         * an array of module names like array( 'jquery.foo', 'jquery.bar',
-        * 'jquery.ui.baz', 'jquery.ui.quux' )
+        * 'jquery.ui.baz', 'jquery.ui.quux' ) Also translating ! to .
         * @param $modules String Packed module name list
         * @return array of module names
         */
        public static function expandModuleNames( $modules ) {
                $retval = array();
+               $modules = str_replace( "!", ".", $modules ); # bug 28840 - IE is stupid.
                $exploded = explode( '|', $modules );
                foreach ( $exploded as $group ) {
                        if ( strpos( $group, ',' ) === false ) {
index aa202cc..3ac2c24 100644 (file)
@@ -874,7 +874,7 @@ window.mediaWiki = new ( function( $ ) {
                                var p = prefix === '' ? '' : prefix + '.';
                                arr.push( p + moduleMap[prefix].join( ',' ) );
                        }
-                       return arr.join( '|' );
+                       return arr.join( '|' ).replace( /\./g, '!' );
                }