save path level before recursing into functions, for better cycle detection
authorSteve Sanbeg <sanbeg@users.mediawiki.org>
Thu, 21 Dec 2006 00:07:13 +0000 (00:07 +0000)
committerSteve Sanbeg <sanbeg@users.mediawiki.org>
Thu, 21 Dec 2006 00:07:13 +0000 (00:07 +0000)
includes/Parser.php

index 1642105..5456512 100644 (file)
@@ -2957,6 +2957,9 @@ class Parser
                }
                wfProfileOut( __METHOD__.'-modifiers' );
 
+               //save path level before recursing into functions & templates.
+               $lastPathLevel = $this->mTemplatePath;
+
                # Parser functions
                if ( !$found ) {
                        wfProfileIn( __METHOD__ . '-pfunc' );
@@ -3025,7 +3028,6 @@ class Parser
                }
 
                # Load from database
-               $lastPathLevel = $this->mTemplatePath;
                if ( !$found ) {
                        wfProfileIn( __METHOD__ . '-loadtpl' );
                        $ns = NS_TEMPLATE;