while instead of if
authorGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 26 May 2004 21:01:58 +0000 (21:01 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Wed, 26 May 2004 21:01:58 +0000 (21:01 +0000)
includes/Parser.php

index cc14f7d..807f544 100644 (file)
@@ -2081,10 +2081,12 @@ function wfBraceSubstitution( $matches )
        global $wgCurParser;
        $titleChars = Title::legalChars();
        # Double brace substitution, expand bar in {{foo{{bar}}}}
-       if(preg_match("/{{([$titleChars]*?)}}/", $matches[2], $internalmatches)) {
+       $i = 0;
+       while(preg_match("/{{([$titleChars]*?)}}/", $matches[2], $internalmatches) and $i < 30) {
                $text = wfInternalBraceSubstitution( $internalmatches );
                $matches[0] = str_replace($internalmatches[0], $text , $matches[0]);
                $matches[2] = str_replace($internalmatches[0], $text , $matches[2]);
+               $i++;
        }
 
        return $wgCurParser->braceSubstitution( $matches );