jenkins-bot has submitted this change and it was merged.
Change subject: resourceloader: Don't add "&*" query parameter to load.php urls
......................................................................
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
---
M includes/resourceloader/ResourceLoader.php
M resources/src/mediawiki/mediawiki.js
M tests/phpunit/includes/OutputPageTest.php
3 files changed, 9 insertions(+), 16 deletions(-)
Approvals:
Tim Starling: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/resourceloader/ResourceLoader.php
b/includes/resourceloader/ResourceLoader.php
index cecb6a2..fd2263b 100644
--- a/includes/resourceloader/ResourceLoader.php
+++ b/includes/resourceloader/ResourceLoader.php
@@ -1486,9 +1486,7 @@
$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 @@
$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 99f824e..56a4699 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 8c8b8b2..ee2b278 100644
--- a/tests/phpunit/includes/OutputPageTest.php
+++ b/tests/phpunit/includes/OutputPageTest.php
@@ -142,20 +142,20 @@
array(
array( 'test.foo',
ResourceLoaderModule::TYPE_SCRIPTS ),
"<script>window.RLQ = window.RLQ || [];
window.RLQ.push( function () {\n"
- .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.foo\u0026only=scripts\u0026skin=fallback\u0026*");'
+ .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.foo\u0026only=scripts\u0026skin=fallback");'
. "\n} );</script>"
),
array(
// Don't condition wrap raw modules (like the
startup module)
array( 'test.raw',
ResourceLoaderModule::TYPE_SCRIPTS ),
- '<script async
src="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.raw&only=scripts&skin=fallback&*"></script>'
+ '<script async
src="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.raw&only=scripts&skin=fallback"></script>'
),
// 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 ),
- '<link rel=stylesheet
href="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.bar%2Cbaz%2Cfoo&only=styles&skin=fallback&*">'
+ '<link rel=stylesheet
href="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.bar%2Cbaz%2Cfoo&only=styles&skin=fallback">'
),
// Load private module (only=scripts)
array(
@@ -180,16 +180,16 @@
// noscript group
array(
array( 'test.noscript',
ResourceLoaderModule::TYPE_STYLES ),
- '<noscript><link rel=stylesheet
href="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.noscript&only=styles&skin=fallback&*"></noscript>'
+ '<noscript><link rel=stylesheet
href="http://127.0.0.1:8080/w/load.php?debug=false&lang=en&modules=test.noscript&only=styles&skin=fallback"></noscript>'
),
// Load two modules in separate groups
array(
array( array( 'test.group.foo',
'test.group.bar' ), ResourceLoaderModule::TYPE_COMBINED ),
"<script>window.RLQ = window.RLQ || [];
window.RLQ.push( function () {\n"
- .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.bar\u0026skin=fallback\u0026*");'
+ .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.bar\u0026skin=fallback");'
. "\n} );</script>\n"
. "<script>window.RLQ = window.RLQ ||
[]; window.RLQ.push( function () {\n"
- .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.foo\u0026skin=fallback\u0026*");'
+ .
'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.foo\u0026skin=fallback");'
. "\n} );</script>"
),
);
--
To view, visit https://gerrit.wikimedia.org/r/234509
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4a4ef7ef5ad7d74ecb47a44342e6324fa9844173
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Edokter <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits