Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/237297

Change subject: Measure string length once in Parser::replaceVariables
......................................................................

Measure string length once in Parser::replaceVariables

Change-Id: I5b1e3f3fa06cb4e2982f3c0d24222ba2ee59ea47
---
M includes/parser/Parser.php
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/97/237297/1

diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php
index 664f0a4..ab5c586 100644
--- a/includes/parser/Parser.php
+++ b/includes/parser/Parser.php
@@ -3326,7 +3326,8 @@
         */
        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;
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/237297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b1e3f3fa06cb4e2982f3c0d24222ba2ee59ea47
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to