ResourceLoader: Permit partial failure in OutputPage::getBottomScripts
Up until recently, `wgPageParseReport` was the only property in the
bottom payload for mw.config. However, with the introduction of
"late variables" in I86d46175639 (e3784468fc, T41813) this can now
contains variables from extension as well.
When a variable moves from one to the other, it should have no difference
other than its position. Currently, this is not the case because the
encoding in `<head>` silently tolerates invalid UTF-8 and has for
several years. The bottom one, however, produces a fatal error.
Change this to make the two more similar.
As of I89832142b55e, encodeJson() improves debugging by logging the
specific error that json_encode encountered as well.
Bug: T329330
Bug: T41813
Change-Id: I1b78e81d08e11dce3426dfc195db5499efdc2dcf
This commit is contained in:
parent
180c2915ec
commit
5a2fa8d28e
1 changed files with 2 additions and 1 deletions
|
|
@ -3516,8 +3516,9 @@ class OutputPage extends ContextSource {
|
|||
$vars['wgPageParseReport'] = $this->limitReportJSData;
|
||||
}
|
||||
if ( $vars ) {
|
||||
$rlContext = $this->getRlClientContext();
|
||||
$chunks[] = ResourceLoader::makeInlineScript(
|
||||
ResourceLoader::makeConfigSetScript( $vars ),
|
||||
'mw.config.set(' . $rlContext->encodeJson( $vars ) . ');',
|
||||
$this->CSP->getNonce()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue