From: Sam Reed Date: Mon, 18 Oct 2010 23:50:33 +0000 (+0000) Subject: Per CR on r45418... X-Git-Tag: 1.31.0-rc.0~34431 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=d08f91f596a0757990c9c7f9eb754dcaaac7e434;p=lhc%2Fweb%2Fwiklou.git Per CR on r45418... Explicitally define $refers = array();, as it being in a loop is just slight confusing with the isset --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3a71a55608..1e2b3afef6 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 ) ) );