From: Timo Tijhof Date: Fri, 28 Aug 2015 12:00:58 +0000 (+0200) Subject: resourceloader: Don't add "&*" query parameter to load.php urls X-Git-Tag: 1.31.0-rc.0~10196 X-Git-Url: http://git.cyclocoop.org/%27%20.%20url_absolue%28%24favicon%29%20.%20?a=commitdiff_plain;h=9d81e0699279a3c426c801649083a16cdfb20d4e;p=lhc%2Fweb%2Fwiklou.git resourceloader: Don't add "&*" query parameter to load.php urls Follows-up r88883 (8dab43f703). The IEUrlExtension library only considers the query string if the base path has no extension (or if the dot is urlencoded). Neither of which is the case for load.php urls. If the server doesn't expose undecoded request URIs (per IEUrlExtension) then it will look in the query string always. However even then it is only an issue if the last query parameter in the url contains a dot, which is very unlikely for load.php (they typically end in 'skin' or 'version' which don't contain plain dots). Ref T30840. Change-Id: I4a4ef7ef5ad7d74ecb47a44342e6324fa9844173 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index cecb6a2706..fd2263bfd2 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1486,9 +1486,7 @@ MESSAGE; $query = self::createLoaderQuery( $context, $extraQuery ); $script = $this->getLoadScript( $source ); - // Prevent the IE6 extension check from being triggered (bug 28840) - // by appending a character that's invalid in Windows extensions ('*') - return wfExpandUrl( wfAppendQuery( $script, $query ) . '&*', PROTO_RELATIVE ); + return wfExpandUrl( wfAppendQuery( $script, $query ), PROTO_RELATIVE ); } /** @@ -1516,9 +1514,7 @@ MESSAGE; $only, $printable, $handheld, $extraQuery ); - // Prevent the IE6 extension check from being triggered (bug 28840) - // by appending a character that's invalid in Windows extensions ('*') - return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ) . '&*', PROTO_RELATIVE ); + return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ), PROTO_RELATIVE ); } /** diff --git a/resources/src/mediawiki/mediawiki.js b/resources/src/mediawiki/mediawiki.js index 99f824eb60..56a4699b6a 100644 --- a/resources/src/mediawiki/mediawiki.js +++ b/resources/src/mediawiki/mediawiki.js @@ -1430,10 +1430,7 @@ currReqBase ); request = sortQuery( request ); - // Support: IE6 - // Append &* to satisfy load.php's WebRequest::checkUrlExtension test. - // This script isn't actually used in IE6, but MediaWiki enforces it in general. - addScript( sourceLoadScript + '?' + $.param( request ) + '&*' ); + addScript( sourceLoadScript + '?' + $.param( request ) ); } /** diff --git a/tests/phpunit/includes/OutputPageTest.php b/tests/phpunit/includes/OutputPageTest.php index 8c8b8b2892..ee2b278d4c 100644 --- a/tests/phpunit/includes/OutputPageTest.php +++ b/tests/phpunit/includes/OutputPageTest.php @@ -142,20 +142,20 @@ class OutputPageTest extends MediaWikiTestCase { array( array( 'test.foo', ResourceLoaderModule::TYPE_SCRIPTS ), "" ), array( // Don't condition wrap raw modules (like the startup module) array( 'test.raw', ResourceLoaderModule::TYPE_SCRIPTS ), - '' + '' ), // Load module styles only // This also tests the order the modules are put into the url array( array( array( 'test.baz', 'test.foo', 'test.bar' ), ResourceLoaderModule::TYPE_STYLES ), - '' + '' ), // Load private module (only=scripts) array( @@ -180,16 +180,16 @@ class OutputPageTest extends MediaWikiTestCase { // noscript group array( array( 'test.noscript', ResourceLoaderModule::TYPE_STYLES ), - '' + '' ), // Load two modules in separate groups array( array( array( 'test.group.foo', 'test.group.bar' ), ResourceLoaderModule::TYPE_COMBINED ), "\n" . "" ), );