Index: trunk/extensions/ArticleComments/ArticleComments.php |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | |
129 | 129 | function wfArticleCommentsParserHook( $text, $params = array(), $parser ) { |
130 | 130 | # Generate a comment form for display |
131 | | - return wfArticleCommentForm( $parser->mTitle, $params ); |
| 131 | + return wfArticleCommentForm( $parser->mTitle, $params, $parser ); |
132 | 132 | } |
133 | 133 | |
134 | 134 | function wfArticleCommentsParserHookComment( $text, $args, $parser, $frame ) { |
— | — | @@ -205,7 +205,7 @@ |
206 | 206 | * @param $skin Object: Skin object |
207 | 207 | */ |
208 | 208 | function wfArticleCommentsAfterContent( $data, $skin ) { |
209 | | - global $wgRequest, $wgArticleCommentsNSDisplayList; |
| 209 | + global $wgRequest, $wgArticleCommentsNSDisplayList, $wgParser; |
210 | 210 | |
211 | 211 | # Short-circuit for anything other than action=view or action=purge |
212 | 212 | if ( $wgRequest->getVal( 'action' ) && |
— | — | @@ -234,7 +234,7 @@ |
235 | 235 | |
236 | 236 | # Display the form |
237 | 237 | if ( in_array( $title->getNamespace(), $nsList ) ) { |
238 | | - $data .= wfArticleCommentForm( $title ); |
| 238 | + $data .= wfArticleCommentForm( $title, array(), $wgParser ); |
239 | 239 | } |
240 | 240 | |
241 | 241 | return true; |
— | — | @@ -245,9 +245,13 @@ |
246 | 246 | * @param $title Object: the title of the article on which the form will appear. |
247 | 247 | * @param $params Array: a hash of parameters containing rendering options. |
248 | 248 | */ |
249 | | -function wfArticleCommentForm( $title, $params = array() ) { |
250 | | - global $wgArticleCommentDefaults, $wgOut; |
| 249 | +function wfArticleCommentForm( $title, $params = array(), $parser ) { |
| 250 | + global $wgArticleCommentDefaults, $wgOut, $wgParser, $wgParserConf; |
251 | 251 | |
| 252 | + if ( $parser === $wgParser ) { # Needed since r82645. Workaround the 'Invalid marker' problem by giving a new parser to wfMsgExt(). |
| 253 | + $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) ); |
| 254 | + } |
| 255 | + |
252 | 256 | # Merge in global defaults if specified |
253 | 257 | $tmp = $wgArticleCommentDefaults; |
254 | 258 | foreach ( $params as $k => $v ) { |