variable instead of using this to overrules the user language preference.
* (bug 19014) If user had deletedhistory right, but not undeleted right, then
show "view" instead of "view/restore" on logs.
+* (bug 19017) TOC level calculation error in an odd case
== API changes in 1.16 ==
elseif ( $level < $prevlevel && $toclevel > 1 ) {
# Decrease TOC level, find level to jump to
- if ( $toclevel == 2 && $level <= $levelCount[1] ) {
- # Can only go down to level 1
- $toclevel = 1;
- } else {
- for ($i = $toclevel; $i > 0; $i--) {
- if ( $levelCount[$i] == $level ) {
- # Found last matching level
- $toclevel = $i;
- break;
- }
- elseif ( $levelCount[$i] < $level ) {
- # Found first matching level below current level
- $toclevel = $i + 1;
- break;
- }
+ for ($i = $toclevel; $i > 0; $i--) {
+ if ( $levelCount[$i] == $level ) {
+ # Found last matching level
+ $toclevel = $i;
+ break;
+ }
+ elseif ( $levelCount[$i] < $level ) {
+ # Found first matching level below current level
+ $toclevel = $i + 1;
+ break;
}
}
+ if( $i == 0 ) $toclevel = 1;
if( $toclevel<$wgMaxTocLevel ) {
if($prevtoclevel < $wgMaxTocLevel) {
# Unindent only if the previous toc level was shown :p