Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -4125,6 +4125,9 @@ |
4126 | 4126 | # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags |
4127 | 4127 | $text = $this->replaceVariables( $text ); |
4128 | 4128 | |
| 4129 | + # This works almost by chance, as the replaceVariables are done before the getUserSig(), |
| 4130 | + # which may corrupt this parser instance via its wfMsgExt( parsemag ) call- |
| 4131 | + |
4129 | 4132 | # Signatures |
4130 | 4133 | $sigText = $this->getUserSig( $user ); |
4131 | 4134 | $text = strtr( $text, array( |
— | — | @@ -4170,6 +4173,8 @@ |
4171 | 4174 | * validated, ready-to-insert wikitext. |
4172 | 4175 | * If you have pre-fetched the nickname or the fancySig option, you can |
4173 | 4176 | * specify them here to save a database query. |
| 4177 | + * Do not reuse this parser instance after calling getUserSig(), |
| 4178 | + * as it may have changed if it's the $wgParser. |
4174 | 4179 | * |
4175 | 4180 | * @param $user User |
4176 | 4181 | * @param $nickname String: nickname to use or false to use user's default nickname |
— | — | @@ -4288,7 +4293,7 @@ |
4289 | 4294 | * Set up some variables which are usually set up in parse() |
4290 | 4295 | * so that an external function can call some class members with confidence |
4291 | 4296 | */ |
4292 | | - public function startExternalParse( Title $title, ParserOptions $options, $outputType, $clearState = true ) { |
| 4297 | + public function startExternalParse( Title $title = null, ParserOptions $options, $outputType, $clearState = true ) { |
4293 | 4298 | $this->setTitle( $title ); |
4294 | 4299 | $this->mOptions = $options; |
4295 | 4300 | $this->setOutputType( $outputType ); |