From: Arash Boostani Date: Wed, 6 May 2009 23:21:55 +0000 (+0000) Subject: Fixed a minor problem with $wgSectionContainers that was causing some divs to not... X-Git-Tag: 1.31.0-rc.0~41861 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=e1e727ec5ddb8574c3af82e1fe09616704429521;p=lhc%2Fweb%2Fwiklou.git Fixed a minor problem with $wgSectionContainers that was causing some divs to not be closed properly --- diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e56157c8ae..7ff348b8cf 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3682,7 +3682,7 @@ class Parser if( !empty( $head[$i] ) ) { # if there's no next header, then don't try to close out any existing sections here # get the level of the next header section preg_match('/ 0 ) { $hLevel = $hLevelMatches[1]; if ( $i != 0 ) { # we don't have an open div for section 0, so don't try to close it @@ -3701,7 +3701,7 @@ class Parser # if we've outputed the last section of the article, close any open divs that are remaining if ( $i == ( count($blocks) - 1) && isset($currentHLevel) ) { - $this->closeSectionContainers( $hLevel, $currentHLevel, $full, $openDivs); + $this->closeSectionContainers( $hLevel, $currentHLevel, $full, $openDivs, true); } } @@ -3727,8 +3727,8 @@ class Parser * @param array $openDivs a reference to the array that stores a list of open section containers * @return true */ - function closeSectionContainers( $hLevel, &$currentHLevel, &$full, &$openDivs) { - while ( $hLevel <= $currentHLevel ) { + function closeSectionContainers( $hLevel, &$currentHLevel, &$full, &$openDivs, $lastCall=false) { + while ( $hLevel <= $currentHLevel || $lastCall) { $full .= ''; $popped = array_pop($openDivs); if ( count($openDivs) ) {