From a7056e3c695c2fdf304fd5c8cf7a92baacc8836c Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Tue, 8 Sep 2015 18:48:33 -0700 Subject: [PATCH] Measure string length once in Parser::replaceVariables Change-Id: I5b1e3f3fa06cb4e2982f3c0d24222ba2ee59ea47 --- includes/parser/Parser.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.20.1