Handle {{/subpage}} properly
authorGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 24 Mar 2006 16:44:52 +0000 (16:44 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Fri, 24 Mar 2006 16:44:52 +0000 (16:44 +0000)
includes/Parser.php

index ff66e13..4329bd1 100644 (file)
@@ -2616,7 +2616,11 @@ class Parser
                $lastPathLevel = $this->mTemplatePath;
                if ( !$found ) {
                        $ns = NS_TEMPLATE;
-                       $part1 = $this->maybeDoSubpageLink( $part1, $subpage='' );
+                       # declaring $subpage directly in the function call
+                       # does not work correctly with references and breaks
+                       # {{/subpage}}-style inclusions
+                       $subpage = '';
+                       $part1 = $this->maybeDoSubpageLink( $part1, $subpage );
                        if ($subpage !== '') {
                                $ns = $this->mTitle->getNamespace();
                        }