From 2a368380cf62ebafba5491cb50f94801196c8307 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 1 Jun 2006 21:22:05 +0000 Subject: [PATCH] * (bug 6164) Fix regression with resetting state --- RELEASE-NOTES | 1 + includes/Parser.php | 18 ++++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f16adbeb38..438af19ca3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 resetting state == Compatibility == diff --git a/includes/Parser.php b/includes/Parser.php index f969f7b910..eb7a78df22 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -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(); } -- 2.20.1