r13868 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13867‎ | r13868 | r13869 >
Date:19:47, 25 April 2006
Author:hashar
Status:old
Tags:
Comment:
BACKPORT from trunk@13867:
Fix #4834: correct XHTML output when using $wgMaxTocLevel
Modified paths:
  • /branches/REL1_6/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_6/phase3/includes/Parser.php (modified) (history)

Diff [purge]

Index: branches/REL1_6/phase3/includes/Parser.php
@@ -3059,7 +3059,9 @@
30603060 # Increase TOC level
30613061 $toclevel++;
30623062 $sublevelCount[$toclevel] = 0;
3063 - $toc .= $sk->tocIndent();
 3063+ if( $toclevel<$wgMaxTocLevel ) {
 3064+ $toc .= $sk->tocIndent();
 3065+ }
30643066 }
30653067 elseif ( $level < $prevlevel && $toclevel > 1 ) {
30663068 # Decrease TOC level, find level to jump to
@@ -3081,12 +3083,15 @@
30823084 }
30833085 }
30843086 }
3085 -
3086 - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3087+ if( $toclevel<$wgMaxTocLevel ) {
 3088+ $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3089+ }
30873090 }
30883091 else {
30893092 # No change in level, end TOC line
3090 - $toc .= $sk->tocLineEnd();
 3093+ if( $toclevel<$wgMaxTocLevel ) {
 3094+ $toc .= $sk->tocLineEnd();
 3095+ }
30913096 }
30923097
30933098 $levelCount[$toclevel] = $level;
@@ -3166,7 +3171,9 @@
31673172 }
31683173
31693174 if( $doShowToc ) {
3170 - $toc .= $sk->tocUnindent( $toclevel - 1 );
 3175+ if( $toclevel<$wgMaxTocLevel ) {
 3176+ $toc .= $sk->tocUnindent( $toclevel - 1 );
 3177+ }
31713178 $toc = $sk->tocList( $toc );
31723179 }
31733180
Index: branches/REL1_6/phase3/RELEASE-NOTES
@@ -33,6 +33,7 @@
3434 * Fix for concurrency problem in job queue (image description page invalidation)
3535 * (bug 5497) regeression in HTML normalization in 1.6 (unclosed <li>,<dd>,<dt>)
3636 * (bug 5709) Allow customisation of separator for categories
 37+* (bug 4834) Fix XHTML output when using $wgMaxTocLevel
3738
3839
3940 == MediaWiki 1.6.3 ==

Status & tagging log