http://www.mediawiki.org/wiki/Special:Code/MediaWiki/74159

Revision: 74159
Author:   platonides
Date:     2010-10-02 21:45:15 +0000 (Sat, 02 Oct 2010)

Log Message:
-----------
Do not use ForContent messages for the Special page messages.
Note however that messages which end up in the talk page use the content one, 
as do those that appear in the comments form (for parser cache).

Modified Paths:
--------------
    trunk/extensions/ArticleComments/ArticleComments.php

Modified: trunk/extensions/ArticleComments/ArticleComments.php
===================================================================
--- trunk/extensions/ArticleComments/ArticleComments.php        2010-10-02 
21:40:43 UTC (rev 74158)
+++ trunk/extensions/ArticleComments/ArticleComments.php        2010-10-02 
21:45:15 UTC (rev 74159)
@@ -305,27 +305,30 @@
        # Perform validation checks on supplied fields
        $messages = array();
 
-       if ( !$wgRequest->wasPosted() )
-               $messages[] = wfMsgForContent( 'article-comments-not-posted' );
+       if ( !$wgRequest->wasPosted() ) {
+               $messages[] = wfMsg( 'article-comments-not-posted' );
+       }
 
        if ( $titleText === '' || !$title ) {
-               $messages[] = wfMsgForContent(
-               'article-comments-invalid-field', wfMsgForContent( 
'article-comments-title-string' ), $titleText );
+               $messages[] = wfMsg( 'article-comments-invalid-field', 
wfMsgForContent( 'article-comments-title-string' ), $titleText );
        }
 
-       if ( !$commenterName ) $messages[] = wfMsgForContent(
-               'article-comments-required-field', wfMsgForContent( 
'article-comments-name-string' ) );
+       if ( !$commenterName ) {
+               $messages[] = wfMsg( 'article-comments-required-field', 
wfMsgForContent( 'article-comments-name-string' ) );
+       }
 
-       if ( ( $commenterURL != '' ) && !preg_match( "/^(" . wfUrlProtocols() . 
')' . Parser::EXT_LINK_URL_CLASS . '+$/', $commenterURL ) )
-               $messages[] = wfMsgForContent(
-               'article-comments-invalid-field', wfMsgForContent( 
'article-comments-url-string' ), $commenterURL );
+       if ( ( $commenterURL != '' ) && !preg_match( "/^(" . wfUrlProtocols() . 
')' . Parser::EXT_LINK_URL_CLASS . '+$/', $commenterURL ) ) {
+               $messages[] = wfMsg( 'article-comments-invalid-field', 
wfMsgForContent( 'article-comments-url-string' ), $commenterURL );
+       }
 
-       if ( !$comment ) $messages[] = wfMsgForContent(
-               'article-comments-required-field', wfMsgForContent( 
'article-comments-comment-string' ) );
+       if ( !$comment ) {
+               $messages[] = wfMsg('article-comments-required-field', wfMsg( 
'article-comments-comment-string' ) );
+       }
+
        if ( !empty( $messages ) ) {
-               $wgOut->setPageTitle( wfMsgForContent( 
'article-comments-submission-failed' ) );
+               $wgOut->setPageTitle( wfMsg( 
'article-comments-submission-failed' ) );
                $wikiText = "<div class='errorbox'>";
-               $wikiText .= wfMsgForContent( 
'article-comments-failure-reasons' ) . "\n\n";
+               $wikiText .= wfMsg( 'article-comments-failure-reasons' ) . 
"\n\n";
                foreach ( $messages as $message ) {
                        $wikiText .= "* $message\n";
                }
@@ -341,10 +344,10 @@
 
        # Check whether user is blocked from editing the talk page
        if ( $wgUser->isBlockedFrom( $talkTitle ) ) {
-               $wgOut->setPageTitle( wfMsgForContent( 
'article-comments-submission-failed' ) );
+               $wgOut->setPageTitle( wfMsg( 
'article-comments-submission-failed' ) );
                $wikiText = "<div class='errorbox'>";
-               $wikiText .= wfMsgForContent( 
'article-comments-failure-reasons' ) . "\n\n";
-               $wikiText .= '* ' . wfMsgForContent( 
'article-comments-user-is-blocked', $talkTitle->getPrefixedText() ) . "\n";
+               $wikiText .= wfMsg( 'article-comments-failure-reasons' ) . 
"\n\n";
+               $wikiText .= '* ' . wfMsg( 'article-comments-user-is-blocked', 
$talkTitle->getPrefixedText() ) . "\n";
                $wgOut->addWikiText( $wikiText . "</div>" );
                return;
        }
@@ -379,7 +382,7 @@
                $wgOut->setPageTitle( wfMsgForContent( 
'article-comments-submission-failed' ) );
                $wgOut->addWikiText(
                        "<div class='errorbox'>" .
-                       wfMsgForContent( 'article-comments-no-comments', 
$title->getPrefixedText() ) .
+                       wfMsg( 'article-comments-no-comments', 
$title->getPrefixedText() ) .
                        "</div>"
                );
                return;
@@ -391,10 +394,10 @@
 
        # If it's spam - it's gone!
        if ( $isspam ) {
-               $wgOut->setPageTitle( wfMsgForContent( 
'article-comments-submission-failed' ) );
+               $wgOut->setPageTitle( wfMsg( 
'article-comments-submission-failed' ) );
                $wgOut->addWikiText(
                        "<div class='errorbox'>" .
-                       wfMsgForContent( 'article-comments-no-spam' ) .
+                       wfMsg( 'article-comments-no-spam' ) .
                        "</div>"
                );
                return;
@@ -436,9 +439,9 @@
        $summary = wfMsgForContent( 'article-comments-summary', $commenterName 
);
        $talkArticle->doEdit( $talkContent, $summary );
 
-       $wgOut->setPageTitle( wfMsgForContent( 
'article-comments-submission-succeeded' ) );
-       $wgOut->addWikiText(  wfMsgForContent( 
'article-comments-submission-success', $title->getPrefixedText() ) );
-       $wgOut->addWikiText(  wfMsgForContent( 
'article-comments-submission-view-all', $talkTitle->getPrefixedText() ) );
+       $wgOut->setPageTitle( wfMsg( 'article-comments-submission-succeeded' ) 
);
+       $wgOut->addWikiText(  wfMsg( 'article-comments-submission-success', 
$title->getPrefixedText() ) );
+       $wgOut->addWikiText(  wfMsg( 'article-comments-submission-view-all', 
$talkTitle->getPrefixedText() ) );
 }
 
 /**



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to