* Fix typo in Linker.php
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 14 Jul 2009 13:35:07 +0000 (13:35 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 14 Jul 2009 13:35:07 +0000 (13:35 +0000)
* Only call ParserOutput::setTOCHTML() if a TOC was really generated

includes/Linker.php
includes/parser/Parser.php

index a799dce..93ac43d 100644 (file)
@@ -1180,7 +1180,7 @@ class Linker {
                foreach ( $tree as $section ) {
                        if ( $section['toclevel'] > $lastLevel )
                                $toc .= $this->tocIndent();
-                       else if ( $secton['toclevel'] < $lastLevel )
+                       else if ( $section['toclevel'] < $lastLevel )
                                $toc .= $this->tocUnindent(
                                        $lastLevel - $section['toclevel'] );
                        else
index 768c9cb..5a674c5 100644 (file)
@@ -3734,11 +3734,11 @@ class Parser
                                $toc .= $sk->tocUnindent( $prevtoclevel - 1 );
                        }
                        $toc = $sk->tocList( $toc );
+                       $this->mOutput->setTOCHTML( $toc );
                }
                
                if ( $isMain ) {
                        $this->mOutput->setSections( $tocraw );
-                       $this->mOutput->setTOCHTML( $toc );
                }
 
                # split up and insert constructed headlines