Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3477,23 +3477,19 @@ |
3478 | 3478 | elseif ( $level < $prevlevel && $toclevel > 1 ) { |
3479 | 3479 | # Decrease TOC level, find level to jump to |
3480 | 3480 | |
3481 | | - if ( $toclevel == 2 && $level <= $levelCount[1] ) { |
3482 | | - # Can only go down to level 1 |
3483 | | - $toclevel = 1; |
3484 | | - } else { |
3485 | | - for ($i = $toclevel; $i > 0; $i--) { |
3486 | | - if ( $levelCount[$i] == $level ) { |
3487 | | - # Found last matching level |
3488 | | - $toclevel = $i; |
3489 | | - break; |
3490 | | - } |
3491 | | - elseif ( $levelCount[$i] < $level ) { |
3492 | | - # Found first matching level below current level |
3493 | | - $toclevel = $i + 1; |
3494 | | - break; |
3495 | | - } |
| 3481 | + for ($i = $toclevel; $i > 0; $i--) { |
| 3482 | + if ( $levelCount[$i] == $level ) { |
| 3483 | + # Found last matching level |
| 3484 | + $toclevel = $i; |
| 3485 | + break; |
3496 | 3486 | } |
| 3487 | + elseif ( $levelCount[$i] < $level ) { |
| 3488 | + # Found first matching level below current level |
| 3489 | + $toclevel = $i + 1; |
| 3490 | + break; |
| 3491 | + } |
3497 | 3492 | } |
| 3493 | + if( $i == 0 ) $toclevel = 1; |
3498 | 3494 | if( $toclevel<$wgMaxTocLevel ) { |
3499 | 3495 | if($prevtoclevel < $wgMaxTocLevel) { |
3500 | 3496 | # Unindent only if the previous toc level was shown :p |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | variable instead of using this to overrules the user language preference. |
182 | 182 | * (bug 19014) If user had deletedhistory right, but not undeleted right, then |
183 | 183 | show "view" instead of "view/restore" on logs. |
| 184 | +* (bug 19017) TOC level calculation error in an odd case |
184 | 185 | |
185 | 186 | == API changes in 1.16 == |
186 | 187 | |