From: Antoine Musso Date: Thu, 3 May 2007 19:36:24 +0000 (+0000) Subject: Fix #6204 : only unindent toc if we indented it previously. X-Git-Tag: 1.31.0-rc.0~53097 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=465e41a1087bfac2d2fac907470a6415ddd70354;p=lhc%2Fweb%2Fwiklou.git Fix #6204 : only unindent toc if we indented it previously. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 10e6e80f6c..21d0bda31b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -31,6 +31,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 9712) Use Arabic comma in date/time formats for Arabic and Farsi * (bug 9670) Follow redirects when render edit section links to transcluded templates. +* (bug 6204) Fix incorrect unindentation with $wgMaxTocLevel == Maintenance script changes since 1.10 == diff --git a/includes/Parser.php b/includes/Parser.php index c4396c2b9d..0ef3d2b673 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -3536,7 +3536,12 @@ class Parser } } if( $toclevel<$wgMaxTocLevel ) { - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); + if($prevtoclevel < $wgMaxTocLevel) { + # Unindent only if the previous toc level was shown :p + $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel ); + } else { + $toc .= $sk->tocLineEnd(); + } } } else {