Per CR on r45418...
authorSam Reed <reedy@users.mediawiki.org>
Mon, 18 Oct 2010 23:50:33 +0000 (23:50 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 18 Oct 2010 23:50:33 +0000 (23:50 +0000)
Explicitally define $refers = array();, as it being in a loop is just slight confusing with the isset

includes/parser/Parser.php

index 3a71a55..1e2b3af 100644 (file)
@@ -3767,6 +3767,7 @@ class Parser {
                $node = $root->getFirstChild();
                $byteOffset = 0;
                $tocraw = array();
+               $refers = array();
 
                foreach ( $matches[3] as $headline ) {
                        $isTemplate = false;
@@ -3941,8 +3942,9 @@ class Parser {
                        while ( $node && !$isTemplate ) {
                                if ( $node->getName() === 'h' ) {
                                        $bits = $node->splitHeading();
-                                       if ( $bits['i'] == $sectionIndex )
+                                       if ( $bits['i'] == $sectionIndex ) {
                                                break;
+                                       }
                                }
                                $byteOffset += mb_strlen( $this->mStripState->unstripBoth(
                                        $frame->expand( $node, PPFrame::RECOVER_ORIG ) ) );