From: Ori Livneh Date: Wed, 9 Sep 2015 01:48:33 +0000 (-0700) Subject: Measure string length once in Parser::replaceVariables X-Git-Tag: 1.31.0-rc.0~10073^2 X-Git-Url: http://git.cyclocoop.org//%22%22.url_de_base%28%29.%22/%22?a=commitdiff_plain;h=a7056e3c695c2fdf304fd5c8cf7a92baacc8836c;p=lhc%2Fweb%2Fwiklou.git Measure string length once in Parser::replaceVariables Change-Id: I5b1e3f3fa06cb4e2982f3c0d24222ba2ee59ea47 --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 664f0a4be0..ab5c58695c 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3326,7 +3326,8 @@ class Parser { */ public function replaceVariables( $text, $frame = false, $argsOnly = false ) { # Is there any text? Also, Prevent too big inclusions! - if ( strlen( $text ) < 1 || strlen( $text ) > $this->mOptions->getMaxIncludeSize() ) { + $textSize = strlen( $text ); + if ( $textSize < 1 || $textSize > $this->mOptions->getMaxIncludeSize() ) { return $text; }