Index: trunk/extensions/ProofreadPage/ProofreadPage.php |
— | — | @@ -287,14 +287,15 @@ |
288 | 288 | */ |
289 | 289 | function pr_parse_index_links( $index_title ){ |
290 | 290 | |
| 291 | + # Instanciate a new parser object to avoid side effects of $parser->replaceVariables |
| 292 | + global $pr_index_parser; |
| 293 | + if( is_null($pr_index_parser) ) { |
| 294 | + $pr_index_parser = new Parser; |
| 295 | + } |
291 | 296 | $rev = Revision::newFromTitle( $index_title ); |
292 | 297 | $text = $rev->getText(); |
293 | | - # Instanciate a new parser object to avoid side effects of $parser->replaceVariables |
294 | | - $parser = new Parser; |
295 | | - $parser->clearState(); |
296 | | - $parser->mOptions = new ParserOptions(); |
297 | | - $parser->setTitle( $index_title ); |
298 | | - $rtext = $parser->replaceVariables( $text ); |
| 298 | + $options = new ParserOptions(); |
| 299 | + $rtext = $pr_index_parser->preprocess( $text, $index_title, $options ); |
299 | 300 | $text_links_pattern = "/\[\[([^:\|]*?)(\|(.*?)|)\]\]/i"; |
300 | 301 | preg_match_all( $text_links_pattern, $rtext, $text_links, PREG_PATTERN_ORDER ); |
301 | 302 | return $text_links; |