short-circuit replaceVariables() for all the empty text that seems to come in
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 2 Mar 2009 02:06:01 +0000 (02:06 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 2 Mar 2009 02:06:01 +0000 (02:06 +0000)
includes/parser/Parser.php

index e0fbb15..bff3498 100644 (file)
@@ -2608,11 +2608,10 @@ class Parser
         * @private
         */
        function replaceVariables( $text, $frame = false, $argsOnly = false ) {
-               # Prevent too big inclusions
-               if( strlen( $text ) > $this->mOptions->getMaxIncludeSize() ) {
+               # Is there any text? Also, Prevent too big inclusions!
+               if ( strlen( $text ) < 1 || strlen( $text ) > $this->mOptions->getMaxIncludeSize() ) {
                        return $text;
                }
-
                wfProfileIn( __METHOD__ );
 
                if ( $frame === false ) {