From: Brian Wolff Date: Mon, 28 Sep 2015 22:39:31 +0000 (-0600) Subject: Do not split parser cache if limitation is reached. X-Git-Tag: 1.31.0-rc.0~9617^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27user_edit%27%2C%20userid=session.user.id%29%20%7D%7D?a=commitdiff_plain;h=e4c016a208f8291518c6f6ae5bbb9fd6b738ae73;p=lhc%2Fweb%2Fwiklou.git Do not split parser cache if limitation is reached. The warnings are only shown during preview. It seems silly to split the parser cache for this. There should be no parser cache pollution to just using the user language without registering it for use. See also: 889e988ccec3428a10c831 Change-Id: Ib42e8885e23a3c8bef8cf72948359d71254064c3 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3b49ccf538..bbee9d4e89 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3385,6 +3385,8 @@ class Parser { * Warn the user when a parser limitation is reached * Will warn at most once the user per limitation type * + * The results are shown during preview and run through the Parser (See EditPage.php) + * * @param string $limitationType Should be one of: * 'expensive-parserfunction' (corresponding messages: * 'expensive-parserfunction-warning', @@ -3407,8 +3409,10 @@ class Parser { */ public function limitationWarn( $limitationType, $current = '', $max = '' ) { # does no harm if $current and $max are present but are unnecessary for the message + # Not doing ->inLanguage( $this->mOptions->getUserLangObj() ), since this is shown + # only during preview, and that would split the parser cache unnecessarily. $warning = wfMessage( "$limitationType-warning" )->numParams( $current, $max ) - ->inLanguage( $this->mOptions->getUserLangObj() )->text(); + ->text(); $this->mOutput->addWarning( $warning ); $this->addTrackingCategory( "$limitationType-category" ); }