Index: trunk/extensions/ArticleComments/ArticleComments.php |
— | — | @@ -305,27 +305,30 @@ |
306 | 306 | # Perform validation checks on supplied fields |
307 | 307 | $messages = array(); |
308 | 308 | |
309 | | - if ( !$wgRequest->wasPosted() ) |
310 | | - $messages[] = wfMsgForContent( 'article-comments-not-posted' ); |
| 309 | + if ( !$wgRequest->wasPosted() ) { |
| 310 | + $messages[] = wfMsg( 'article-comments-not-posted' ); |
| 311 | + } |
311 | 312 | |
312 | 313 | if ( $titleText === '' || !$title ) { |
313 | | - $messages[] = wfMsgForContent( |
314 | | - 'article-comments-invalid-field', wfMsgForContent( 'article-comments-title-string' ), $titleText ); |
| 314 | + $messages[] = wfMsg( 'article-comments-invalid-field', wfMsgForContent( 'article-comments-title-string' ), $titleText ); |
315 | 315 | } |
316 | 316 | |
317 | | - if ( !$commenterName ) $messages[] = wfMsgForContent( |
318 | | - 'article-comments-required-field', wfMsgForContent( 'article-comments-name-string' ) ); |
| 317 | + if ( !$commenterName ) { |
| 318 | + $messages[] = wfMsg( 'article-comments-required-field', wfMsgForContent( 'article-comments-name-string' ) ); |
| 319 | + } |
319 | 320 | |
320 | | - if ( ( $commenterURL != '' ) && !preg_match( "/^(" . wfUrlProtocols() . ')' . Parser::EXT_LINK_URL_CLASS . '+$/', $commenterURL ) ) |
321 | | - $messages[] = wfMsgForContent( |
322 | | - 'article-comments-invalid-field', wfMsgForContent( 'article-comments-url-string' ), $commenterURL ); |
| 321 | + if ( ( $commenterURL != '' ) && !preg_match( "/^(" . wfUrlProtocols() . ')' . Parser::EXT_LINK_URL_CLASS . '+$/', $commenterURL ) ) { |
| 322 | + $messages[] = wfMsg( 'article-comments-invalid-field', wfMsgForContent( 'article-comments-url-string' ), $commenterURL ); |
| 323 | + } |
323 | 324 | |
324 | | - if ( !$comment ) $messages[] = wfMsgForContent( |
325 | | - 'article-comments-required-field', wfMsgForContent( 'article-comments-comment-string' ) ); |
| 325 | + if ( !$comment ) { |
| 326 | + $messages[] = wfMsg('article-comments-required-field', wfMsg( 'article-comments-comment-string' ) ); |
| 327 | + } |
| 328 | + |
326 | 329 | if ( !empty( $messages ) ) { |
327 | | - $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
| 330 | + $wgOut->setPageTitle( wfMsg( 'article-comments-submission-failed' ) ); |
328 | 331 | $wikiText = "<div class='errorbox'>"; |
329 | | - $wikiText .= wfMsgForContent( 'article-comments-failure-reasons' ) . "\n\n"; |
| 332 | + $wikiText .= wfMsg( 'article-comments-failure-reasons' ) . "\n\n"; |
330 | 333 | foreach ( $messages as $message ) { |
331 | 334 | $wikiText .= "* $message\n"; |
332 | 335 | } |
— | — | @@ -341,10 +344,10 @@ |
342 | 345 | |
343 | 346 | # Check whether user is blocked from editing the talk page |
344 | 347 | if ( $wgUser->isBlockedFrom( $talkTitle ) ) { |
345 | | - $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
| 348 | + $wgOut->setPageTitle( wfMsg( 'article-comments-submission-failed' ) ); |
346 | 349 | $wikiText = "<div class='errorbox'>"; |
347 | | - $wikiText .= wfMsgForContent( 'article-comments-failure-reasons' ) . "\n\n"; |
348 | | - $wikiText .= '* ' . wfMsgForContent( 'article-comments-user-is-blocked', $talkTitle->getPrefixedText() ) . "\n"; |
| 350 | + $wikiText .= wfMsg( 'article-comments-failure-reasons' ) . "\n\n"; |
| 351 | + $wikiText .= '* ' . wfMsg( 'article-comments-user-is-blocked', $talkTitle->getPrefixedText() ) . "\n"; |
349 | 352 | $wgOut->addWikiText( $wikiText . "</div>" ); |
350 | 353 | return; |
351 | 354 | } |
— | — | @@ -379,7 +382,7 @@ |
380 | 383 | $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
381 | 384 | $wgOut->addWikiText( |
382 | 385 | "<div class='errorbox'>" . |
383 | | - wfMsgForContent( 'article-comments-no-comments', $title->getPrefixedText() ) . |
| 386 | + wfMsg( 'article-comments-no-comments', $title->getPrefixedText() ) . |
384 | 387 | "</div>" |
385 | 388 | ); |
386 | 389 | return; |
— | — | @@ -391,10 +394,10 @@ |
392 | 395 | |
393 | 396 | # If it's spam - it's gone! |
394 | 397 | if ( $isspam ) { |
395 | | - $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-failed' ) ); |
| 398 | + $wgOut->setPageTitle( wfMsg( 'article-comments-submission-failed' ) ); |
396 | 399 | $wgOut->addWikiText( |
397 | 400 | "<div class='errorbox'>" . |
398 | | - wfMsgForContent( 'article-comments-no-spam' ) . |
| 401 | + wfMsg( 'article-comments-no-spam' ) . |
399 | 402 | "</div>" |
400 | 403 | ); |
401 | 404 | return; |
— | — | @@ -436,9 +439,9 @@ |
437 | 440 | $summary = wfMsgForContent( 'article-comments-summary', $commenterName ); |
438 | 441 | $talkArticle->doEdit( $talkContent, $summary ); |
439 | 442 | |
440 | | - $wgOut->setPageTitle( wfMsgForContent( 'article-comments-submission-succeeded' ) ); |
441 | | - $wgOut->addWikiText( wfMsgForContent( 'article-comments-submission-success', $title->getPrefixedText() ) ); |
442 | | - $wgOut->addWikiText( wfMsgForContent( 'article-comments-submission-view-all', $talkTitle->getPrefixedText() ) ); |
| 443 | + $wgOut->setPageTitle( wfMsg( 'article-comments-submission-succeeded' ) ); |
| 444 | + $wgOut->addWikiText( wfMsg( 'article-comments-submission-success', $title->getPrefixedText() ) ); |
| 445 | + $wgOut->addWikiText( wfMsg( 'article-comments-submission-view-all', $talkTitle->getPrefixedText() ) ); |
443 | 446 | } |
444 | 447 | |
445 | 448 | /** |