r13867 MediaWiki - Code Review archive

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

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -3106,7 +3106,9 @@
31073107 # Increase TOC level
31083108 $toclevel++;
31093109 $sublevelCount[$toclevel] = 0;
3110 - $toc .= $sk->tocIndent();
 3110+ if( $toclevel<$wgMaxTocLevel ) {
 3111+ $toc .= $sk->tocIndent();
 3112+ }
31113113 }
31123114 elseif ( $level < $prevlevel && $toclevel > 1 ) {
31133115 # Decrease TOC level, find level to jump to
@@ -3128,12 +3130,15 @@
31293131 }
31303132 }
31313133 }
3132 -
3133 - $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3134+ if( $toclevel<$wgMaxTocLevel ) {
 3135+ $toc .= $sk->tocUnindent( $prevtoclevel - $toclevel );
 3136+ }
31343137 }
31353138 else {
31363139 # No change in level, end TOC line
3137 - $toc .= $sk->tocLineEnd();
 3140+ if( $toclevel<$wgMaxTocLevel ) {
 3141+ $toc .= $sk->tocLineEnd();
 3142+ }
31383143 }
31393144
31403145 $levelCount[$toclevel] = $level;
@@ -3213,7 +3218,9 @@
32143219 }
32153220
32163221 if( $doShowToc ) {
3217 - $toc .= $sk->tocUnindent( $toclevel - 1 );
 3222+ if( $toclevel<$wgMaxTocLevel ) {
 3223+ $toc .= $sk->tocUnindent( $toclevel - 1 );
 3224+ }
32183225 $toc = $sk->tocList( $toc );
32193226 }
32203227
Index: trunk/phase3/RELEASE-NOTES
@@ -123,6 +123,7 @@
124124 * Indicate when a protected page is an interface message ("protectedinterface")
125125 * (bug 4259) Indicate when a protected page being edited is an interface message
126126 ("editinginterface")
 127+* (bug 4834) Fix XHTML output when using $wgMaxTocLevel
127128
128129 == Compatibility ==
129130

Status & tagging log