From: Reedy Date: Mon, 14 Oct 2013 23:33:34 +0000 (+0100) Subject: Add $wgEnableParserLimitReporting to control whether the NewPP limit X-Git-Tag: 1.31.0-rc.0~18483 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=4c3b64e05e972463395b1333f10afb1898a21973;p=lhc%2Fweb%2Fwiklou.git Add $wgEnableParserLimitReporting to control whether the NewPP limit report is included as a HTML comment. Bug: 26792 Change-Id: I2b2b3c9d76487168243b733c1154c4c26c7de3d6 --- diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 289f008723..b988294e8f 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -244,6 +244,8 @@ production. the output of the API query meta=siteinfo&siprop=statistics * Primary keys have been added to both the archive table and the externallinks tables. +* Added $wgEnableParserLimitReporting to control whether the NewPP limit report is + output in a HTML comment. === Bug fixes in 1.22 === * Disable Special:PasswordReset when $wgEnableEmail is false. Previously one diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index ab03be32a0..a0a1b3edb8 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -5936,6 +5936,11 @@ $wgExtensionEntryPointListFiles = array(); */ $wgParserOutputHooks = array(); +/** + * Whether to include the NewPP limit report as a HTML comment + */ +$wgEnableParserLimitReporting = true; + /** * List of valid skin names. * The key should be the name in all lower case, the value should be a properly diff --git a/includes/content/ContentHandler.php b/includes/content/ContentHandler.php index a8fa9ed4dd..2a92e23389 100644 --- a/includes/content/ContentHandler.php +++ b/includes/content/ContentHandler.php @@ -938,7 +938,7 @@ abstract class ContentHandler { * @return ParserOptions */ public function makeParserOptions( $context ) { - global $wgContLang; + global $wgContLang, $wgEnableParserLimitReporting; if ( $context instanceof IContextSource ) { $options = ParserOptions::newFromContext( $context ); @@ -950,7 +950,7 @@ abstract class ContentHandler { throw new MWException( "Bad context for parser options: $context" ); } - $options->enableLimitReport(); // show inclusion/loop reports + $options->enableLimitReport( $wgEnableParserLimitReporting ); // show inclusion/loop reports $options->setTidy( true ); // fix bad HTML return $options;