Index: trunk/extensions/Babel/BabelAutoCreate.class.php |
— | — | @@ -45,6 +45,16 @@ |
46 | 46 | return; |
47 | 47 | } |
48 | 48 | |
| 49 | + |
| 50 | + /* $article->doEdit will call $wgParser->parse. |
| 51 | + * Calling Parser::parse recursively is baaaadd... (bug 29245) |
| 52 | + * @todo FIXME: surely there is a better way? |
| 53 | + */ |
| 54 | + global $wgParser, $wgParserConf; |
| 55 | + $oldParser = $wgParser; |
| 56 | + $parserClass = $wgParserConf['class']; |
| 57 | + $wgParser = new $parserClass( $wgParserConf ); |
| 58 | + |
49 | 59 | $article->doEdit( |
50 | 60 | $text, |
51 | 61 | wfMsgForContent( 'babel-autocreate-reason', wfMsgForContent( 'babel-url' ) ), |
— | — | @@ -52,6 +62,8 @@ |
53 | 63 | false, |
54 | 64 | $user |
55 | 65 | ); |
| 66 | + |
| 67 | + $wgParser = $oldParser; |
56 | 68 | } |
57 | 69 | |
58 | 70 | /** |