From 28adc4d7eef2d7d8e5696a4f9849538a769daa00 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 26 Jul 2016 13:29:17 -0700 Subject: [PATCH 1/1] Only pretty-print the parser report JS vars Follow-up to b7c4c8717f9. Change-Id: I3030df4ed890d9d20daca31fbd33c6d9db91b94c --- includes/OutputPage.php | 7 ++++++- includes/resourceloader/ResourceLoader.php | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index c8a385a510..d34ace8fb0 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3082,7 +3082,12 @@ class OutputPage extends ContextSource { */ function getBottomScripts() { return $this->getScriptsForBottomQueue() . - Skin::makeVariablesScript( [ 'wgPageParseReport' => $this->limitReportData ] ); + ResourceLoader::makeInlineScript( + ResourceLoader::makeConfigSetScript( + [ 'wgPageParseReport' => $this->limitReportData ], + true + ) + ); } /** diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 59f646228e..1a93f6ef13 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1388,13 +1388,14 @@ MESSAGE; * the given value. * * @param array $configuration List of configuration values keyed by variable name + * @param bool $pretty Pretty-print with extra whitespace * @return string */ - public static function makeConfigSetScript( array $configuration ) { + public static function makeConfigSetScript( array $configuration, $pretty = null ) { return Xml::encodeJsCall( 'mw.config.set', [ $configuration ], - true // readable + ( $pretty === null ) ? ResourceLoader::inDebugMode() : $pretty ); } -- 2.20.1