(bug 19323) Calls to recursiveTagParse() overwrite ParserOptions::$mSections, causing...
authorRoan Kattouw <catrope@users.mediawiki.org>
Sun, 21 Jun 2009 12:52:24 +0000 (12:52 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Sun, 21 Jun 2009 12:52:24 +0000 (12:52 +0000)
RELEASE-NOTES
includes/parser/Parser.php

index 0d45332..4200dbd 100644 (file)
@@ -234,6 +234,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added index, fromtitle and byteoffset fields to action=parse&prop=sections
   output
 * (bug 19313) action=rollback returns wrong revid on master/slave setups
+* (bug 19323) action=parse doesn't return section tree on pages with Cite
+  warnings
 
 === Languages updated in 1.16 ===
 
index 5fe307d..82c6af8 100644 (file)
@@ -441,7 +441,7 @@ class Parser
                wfProfileIn( __METHOD__ );
                wfRunHooks( 'ParserBeforeStrip', array( &$this, &$text, &$this->mStripState ) );
                wfRunHooks( 'ParserAfterStrip', array( &$this, &$text, &$this->mStripState ) );
-               $text = $this->internalParse( $text );
+               $text = $this->internalParse( $text, false );
                wfProfileOut( __METHOD__ );
                return $text;
        }
@@ -862,8 +862,7 @@ class Parser
         *
         * @private
         */
-       function internalParse( $text ) {
-               $isMain = true;
+       function internalParse( $text, $isMain = true ) {
                wfProfileIn( __METHOD__ );
                
                $origText = $text;
@@ -3691,7 +3690,6 @@ class Parser
                }
 
                $this->setOutputType( $oldType );
-               $this->mOutput->setSections( $tocraw );
 
                # Never ever show TOC if no headers
                if( $numVisible < 1 ) {
@@ -3705,7 +3703,10 @@ class Parser
                        $toc = $sk->tocList( $toc );
                }
                
-               $this->mOutput->setTOCHTML( $toc );
+               if ( $isMain ) {
+                       $this->mOutput->setSections( $tocraw );
+                       $this->mOutput->setTOCHTML( $toc );
+               }
 
                # split up and insert constructed headlines