* (bug 6164) Fix regression with <gallery> resetting <ref> state
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 1 Jun 2006 21:22:05 +0000 (21:22 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 1 Jun 2006 21:22:05 +0000 (21:22 +0000)
RELEASE-NOTES
includes/Parser.php

index f16adbe..438af19 100644 (file)
@@ -407,6 +407,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   in behavior based on the order tags are loaded.
 * (bug 885) Pre-save transform no longer silently appends close tags
 * Pre-save transform no longer changes the case of close tags
+* (bug 6164) Fix regression with <gallery> resetting <ref> state
 
 
 == Compatibility ==
index f969f7b..eb7a78d 100644 (file)
@@ -3904,10 +3904,6 @@ class Parser
         * 'A tree'.
         */
        function renderImageGallery( $text ) {
-               # Setup the parser
-               $parserOptions = new ParserOptions;
-               $localParser = new Parser();
-
                $ig = new ImageGallery();
                $ig->setShowBytes( false );
                $ig->setShowFilename( false );
@@ -3933,7 +3929,12 @@ class Parser
                                $label = '';
                        }
 
-                       $pout = $localParser->parse( $label , $this->mTitle, $parserOptions );
+                       $pout = $this->parse( $label,
+                               $this->mTitle,
+                               $this->mOptions,
+                               false, // Strip whitespace...?
+                               false  // Don't clear state!
+                       );
                        $html = $pout->getText();
 
                        $ig->add( new Image( $nt ), $html );
@@ -3942,13 +3943,6 @@ class Parser
                        if ( $nt->getNamespace() == NS_IMAGE ) {
                                $this->mOutput->addImage( $nt->getDBkey() );
                        }
-                       
-                       # Register links with the parent parser
-                       foreach( $pout->getLinks() as $ns => $keys ) {
-                               foreach( $keys as $dbk => $id )
-                                       $this->mOutput->addLink( Title::makeTitle( $ns, $dbk ), $id );
-                       }
-                       
                }
                return $ig->toHTML();
        }