resourceloader: Omit default 'debug=false' from load.php urls
Change-Id: I2a2f92b0f0438420105e6a4e4d97eb5f8c480917
This commit is contained in:
parent
b14ab776bd
commit
3dc6b84a31
3 changed files with 30 additions and 28 deletions
|
|
@ -1695,8 +1695,10 @@ MESSAGE;
|
|||
'modules' => self::makePackedModulesString( $modules ),
|
||||
'lang' => $lang,
|
||||
'skin' => $skin,
|
||||
'debug' => $debug ? 'true' : 'false',
|
||||
];
|
||||
if ( $debug === true ) {
|
||||
$query['debug'] = 'true';
|
||||
}
|
||||
if ( $user !== null ) {
|
||||
$query['user'] = $user;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2574,14 +2574,14 @@ class OutputPageTest extends MediaWikiTestCase {
|
|||
[
|
||||
[ 'test.foo', ResourceLoaderModule::TYPE_SCRIPTS ],
|
||||
"<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.foo\u0026only=scripts\u0026skin=fallback");'
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.foo\u0026only=scripts\u0026skin=fallback");'
|
||||
. "});</script>"
|
||||
],
|
||||
// Multiple only=styles load
|
||||
[
|
||||
[ [ '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?lang=en&modules=test.bar%2Cbaz%2Cfoo&only=styles&skin=fallback"/>'
|
||||
],
|
||||
// Private embed (only=scripts)
|
||||
[
|
||||
|
|
@ -2606,14 +2606,14 @@ class OutputPageTest extends MediaWikiTestCase {
|
|||
// noscript group
|
||||
[
|
||||
[ '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?lang=en&modules=test.noscript&only=styles&skin=fallback"/></noscript>'
|
||||
],
|
||||
// Load two modules in separate groups
|
||||
[
|
||||
[ [ 'test.group.foo', 'test.group.bar' ], ResourceLoaderModule::TYPE_COMBINED ],
|
||||
"<script nonce=\"secret\">(window.RLQ=window.RLQ||[]).push(function(){"
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.bar\u0026skin=fallback");'
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?debug=false\u0026lang=en\u0026modules=test.group.foo\u0026skin=fallback");'
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.group.bar\u0026skin=fallback");'
|
||||
. 'mw.loader.load("http://127.0.0.1:8080/w/load.php?lang=en\u0026modules=test.group.foo\u0026skin=fallback");'
|
||||
. "});</script>"
|
||||
],
|
||||
];
|
||||
|
|
@ -2677,13 +2677,13 @@ class OutputPageTest extends MediaWikiTestCase {
|
|||
'default logged-out' => [
|
||||
'exemptStyleModules' => [ 'site' => [ 'site.styles' ] ],
|
||||
'<meta name="ResourceLoaderDynamicStyles" content=""/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=site.styles&only=styles&skin=fallback"/>',
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=fallback"/>',
|
||||
],
|
||||
'default logged-in' => [
|
||||
'exemptStyleModules' => [ 'site' => [ 'site.styles' ], 'user' => [ 'user.styles' ] ],
|
||||
'<meta name="ResourceLoaderDynamicStyles" content=""/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=site.styles&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=user.styles&only=styles&skin=fallback&version=1ai9g6t"/>',
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=user.styles&only=styles&skin=fallback&version=1ai9g6t"/>',
|
||||
],
|
||||
'custom modules' => [
|
||||
'exemptStyleModules' => [
|
||||
|
|
@ -2691,10 +2691,10 @@ class OutputPageTest extends MediaWikiTestCase {
|
|||
'user' => [ 'user.styles', 'example.user' ],
|
||||
],
|
||||
'<meta name="ResourceLoaderDynamicStyles" content=""/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=example.site.a%2Cb&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=site.styles&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=example.user&only=styles&skin=fallback&version=0a56zyi"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=user.styles&only=styles&skin=fallback&version=1ai9g6t"/>',
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=example.site.a%2Cb&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=fallback"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=example.user&only=styles&skin=fallback&version=0a56zyi"/>' . "\n" .
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=en&modules=user.styles&only=styles&skin=fallback&version=1ai9g6t"/>',
|
||||
],
|
||||
];
|
||||
// phpcs:enable
|
||||
|
|
|
|||
|
|
@ -207,9 +207,9 @@ Deprecation message.' ]
|
|||
. 'mw.loader.implement("test.private@{blankVer}",null,{"css":[]});'
|
||||
. 'RLPAGEMODULES=["test"];mw.loader.load(RLPAGEMODULES);'
|
||||
. '});</script>' . "\n"
|
||||
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.deprecated%2Cpure&only=styles&skin=fallback"/>' . "\n"
|
||||
. '<link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.styles.deprecated%2Cpure&only=styles&skin=fallback"/>' . "\n"
|
||||
. '<style>.private{}</style>' . "\n"
|
||||
. '<script async="" src="/w/load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=fallback"></script>';
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&skin=fallback"></script>';
|
||||
// phpcs:enable
|
||||
$expected = self::expandVariables( $expected );
|
||||
|
||||
|
|
@ -229,7 +229,7 @@ Deprecation message.' ]
|
|||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=fallback&target=example"></script>';
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&skin=fallback&target=example"></script>';
|
||||
// phpcs:enable
|
||||
|
||||
$this->assertEquals( $expected, $client->getHeadHtml() );
|
||||
|
|
@ -248,7 +248,7 @@ Deprecation message.' ]
|
|||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?debug=false&lang=nl&modules=startup&only=scripts&safemode=1&skin=fallback"></script>';
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&safemode=1&skin=fallback"></script>';
|
||||
// phpcs:enable
|
||||
|
||||
$this->assertEquals( $expected, $client->getHeadHtml() );
|
||||
|
|
@ -267,7 +267,7 @@ Deprecation message.' ]
|
|||
|
||||
// phpcs:disable Generic.Files.LineLength
|
||||
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
|
||||
. '<script async="" src="/w/load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=fallback"></script>';
|
||||
. '<script async="" src="/w/load.php?lang=nl&modules=startup&only=scripts&skin=fallback"></script>';
|
||||
// phpcs:enable
|
||||
|
||||
$this->assertEquals( $expected, $client->getHeadHtml() );
|
||||
|
|
@ -329,28 +329,28 @@ Deprecation message.' ]
|
|||
'modules' => [ 'test.scripts.raw' ],
|
||||
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
|
||||
'extra' => [],
|
||||
'output' => '<script async="" src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback"></script>',
|
||||
'output' => '<script async="" src="/w/load.php?lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback"></script>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
'modules' => [ 'test.scripts.raw' ],
|
||||
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
|
||||
'extra' => [ 'sync' => '1' ],
|
||||
'output' => '<script src="/w/load.php?debug=false&lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback&sync=1"></script>',
|
||||
'output' => '<script src="/w/load.php?lang=nl&modules=test.scripts.raw&only=scripts&skin=fallback&sync=1"></script>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
'modules' => [ 'test.scripts.user' ],
|
||||
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
|
||||
'extra' => [],
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.scripts.user\u0026only=scripts\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?lang=nl\u0026modules=test.scripts.user\u0026only=scripts\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
'modules' => [ 'test.user' ],
|
||||
'only' => ResourceLoaderModule::TYPE_COMBINED,
|
||||
'extra' => [],
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.user\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?lang=nl\u0026modules=test.user\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
|
||||
],
|
||||
[
|
||||
'context' => [ 'debug' => 'true' ],
|
||||
|
|
@ -365,14 +365,14 @@ Deprecation message.' ]
|
|||
'modules' => [ 'test.styles.pure', 'test.styles.mixed' ],
|
||||
'only' => ResourceLoaderModule::TYPE_STYLES,
|
||||
'extra' => [],
|
||||
'output' => '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.mixed%2Cpure&only=styles&skin=fallback"/>',
|
||||
'output' => '<link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.styles.mixed%2Cpure&only=styles&skin=fallback"/>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
'modules' => [ 'test.styles.noscript' ],
|
||||
'only' => ResourceLoaderModule::TYPE_STYLES,
|
||||
'extra' => [],
|
||||
'output' => '<noscript><link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.noscript&only=styles&skin=fallback"/></noscript>',
|
||||
'output' => '<noscript><link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.styles.noscript&only=styles&skin=fallback"/></noscript>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
|
|
@ -400,7 +400,7 @@ Deprecation message.' ]
|
|||
'modules' => [ 'test', 'test.shouldembed' ],
|
||||
'only' => ResourceLoaderModule::TYPE_COMBINED,
|
||||
'extra' => [],
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test\u0026skin=fallback");mw.loader.implement("test.shouldembed@09p30q0",null,{"css":[]});});</script>',
|
||||
'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?lang=nl\u0026modules=test\u0026skin=fallback");mw.loader.implement("test.shouldembed@09p30q0",null,{"css":[]});});</script>',
|
||||
],
|
||||
[
|
||||
'context' => [],
|
||||
|
|
@ -408,7 +408,7 @@ Deprecation message.' ]
|
|||
'only' => ResourceLoaderModule::TYPE_STYLES,
|
||||
'extra' => [],
|
||||
'output' =>
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
|
||||
. '<style>.shouldembed{}</style>'
|
||||
],
|
||||
[
|
||||
|
|
@ -417,9 +417,9 @@ Deprecation message.' ]
|
|||
'only' => ResourceLoaderModule::TYPE_STYLES,
|
||||
'extra' => [],
|
||||
'output' =>
|
||||
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.ordering.a%2Cb&only=styles&skin=fallback"/>' . "\n"
|
||||
'<link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.ordering.a%2Cb&only=styles&skin=fallback"/>' . "\n"
|
||||
. '<style>.orderingC{}.orderingD{}</style>' . "\n"
|
||||
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.ordering.e&only=styles&skin=fallback"/>'
|
||||
. '<link rel="stylesheet" href="/w/load.php?lang=nl&modules=test.ordering.e&only=styles&skin=fallback"/>'
|
||||
],
|
||||
];
|
||||
// phpcs:enable
|
||||
|
|
|
|||
Loading…
Reference in a new issue