Index: trunk/phase3/includes/Parser.php |
— | — | @@ -4148,18 +4148,27 @@ |
4149 | 4149 | * @return string Signature text |
4150 | 4150 | */ |
4151 | 4151 | function cleanSig( $text, $parsing = false ) { |
4152 | | - global $wgTitle; |
4153 | | - $this->startExternalParse( $wgTitle, new ParserOptions(), $parsing ? OT_WIKI : OT_MSG ); |
| 4152 | + if ( !$parsing ) { |
| 4153 | + global $wgTitle; |
| 4154 | + $this->startExternalParse( $wgTitle, new ParserOptions(), OT_MSG ); |
| 4155 | + } |
4154 | 4156 | |
| 4157 | + # FIXME: regex doesn't respect extension tags or nowiki |
| 4158 | + # => Move this logic to braceSubstitution() |
4155 | 4159 | $substWord = MagicWord::get( 'subst' ); |
4156 | 4160 | $substRegex = '/\{\{(?!(?:' . $substWord->getBaseRegex() . '))/x' . $substWord->getRegexCase(); |
4157 | 4161 | $substText = '{{' . $substWord->getSynonym( 0 ); |
4158 | 4162 | |
4159 | 4163 | $text = preg_replace( $substRegex, $substText, $text ); |
4160 | 4164 | $text = $this->cleanSigInSig( $text ); |
4161 | | - $text = $this->replaceVariables( $text ); |
| 4165 | + $dom = $this->preprocessToDom( $text ); |
| 4166 | + $frame = new PPFrame( $this ); |
| 4167 | + $text = $frame->expand( $dom->documentElement ); |
4162 | 4168 | |
4163 | | - $this->clearState(); |
| 4169 | + if ( !$parsing ) { |
| 4170 | + $text = $this->mStripState->unstripBoth( $text ); |
| 4171 | + } |
| 4172 | + |
4164 | 4173 | return $text; |
4165 | 4174 | } |
4166 | 4175 | |