Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -272,7 +272,13 @@ |
273 | 273 | |
274 | 274 | //links in ns-0. Only if mOptions exist |
275 | 275 | if( $wgParser->mOptions ) { |
| 276 | + # We use Parser::replaceVariables to expand templates |
| 277 | + # However this method has a side effect on wgParser->mOutput->mTemplates, |
| 278 | + # To avoid this, we instanciate a temporary ParserOutput object |
| 279 | + $saved_output = $wgParser->mOutput; |
| 280 | + $wgParser->mOutput = new ParserOutput; |
276 | 281 | $rtext = $wgParser->replaceVariables( $text ); |
| 282 | + $wgParser->mOutput = $saved_output; |
277 | 283 | $text_links_pattern = "/\[\[([^:\|]*?)(\|(.*?)|)\]\]/i"; |
278 | 284 | preg_match_all( $text_links_pattern, $rtext, $text_links, PREG_PATTERN_ORDER ); |
279 | 285 | } |