From: Tim Starling Date: Sat, 1 Dec 2007 06:52:25 +0000 (+0000) Subject: Don't destroy parser state in cleanSig(). Possible fix for bug 12154, pending confirm... X-Git-Tag: 1.31.0-rc.0~50649 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=416187b7a4c0875547d60fbbdf3bb0a26978b938;p=lhc%2Fweb%2Fwiklou.git Don't destroy parser state in cleanSig(). Possible fix for bug 12154, pending confirmation. --- diff --git a/includes/Parser.php b/includes/Parser.php index 17495682cb..372b95d62f 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4148,18 +4148,27 @@ class Parser * @return string Signature text */ function cleanSig( $text, $parsing = false ) { - global $wgTitle; - $this->startExternalParse( $wgTitle, new ParserOptions(), $parsing ? OT_WIKI : OT_MSG ); + if ( !$parsing ) { + global $wgTitle; + $this->startExternalParse( $wgTitle, new ParserOptions(), OT_MSG ); + } + # FIXME: regex doesn't respect extension tags or nowiki + # => Move this logic to braceSubstitution() $substWord = MagicWord::get( 'subst' ); $substRegex = '/\{\{(?!(?:' . $substWord->getBaseRegex() . '))/x' . $substWord->getRegexCase(); $substText = '{{' . $substWord->getSynonym( 0 ); $text = preg_replace( $substRegex, $substText, $text ); $text = $this->cleanSigInSig( $text ); - $text = $this->replaceVariables( $text ); + $dom = $this->preprocessToDom( $text ); + $frame = new PPFrame( $this ); + $text = $frame->expand( $dom->documentElement ); + + if ( !$parsing ) { + $text = $this->mStripState->unstripBoth( $text ); + } - $this->clearState(); return $text; }