* Changed all calls to wfMsgWikiHtml() in core
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 6 Feb 2011 12:38:33 +0000 (12:38 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 6 Feb 2011 12:38:33 +0000 (12:38 +0000)
* Now replacing parameter before parsing where possible
* Used 'parseinline' for 'nosuchuser' message in Special:Userlogin for consistency with other error messages

includes/EditPage.php
includes/OutputPage.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialConfirmemail.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialWatchlist.php

index 57d2590..2969014 100644 (file)
@@ -2049,7 +2049,7 @@ HTML
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setArticleRelated( false );
 
-               $wgOut->addHTML( wfMsgWikiHtml( 'whitelistedittext', $loginLink ) );
+               $wgOut->addWikiMsgArray( 'whitelistedittext', array( $loginLink ), array( 'replaceafter' ) );
                $wgOut->returnToMain( false, $wgTitle );
        }
 
index 946a41a..36b6124 100644 (file)
@@ -2063,7 +2063,7 @@ class OutputPage {
                        array( 'returnto' => $this->getTitle()->getPrefixedText() ),
                        array( 'known', 'noclasses' )
                );
-               $this->addHTML( wfMsgWikiHtml( 'loginreqpagetext', $loginLink ) );
+               $this->addWikiMsgArray( 'loginreqpagetext', array( $loginLink ), array( 'replaceafter' ) );
                $this->addHTML( "\n<!--" . $this->getTitle()->getPrefixedUrl() . '-->' );
 
                # Don't return to the main page if the user can't read it
index e8f60e4..04b8d20 100644 (file)
@@ -301,7 +301,7 @@ class SpecialAllpages extends IncludableSpecialPage {
                $n = 0;
 
                if ( !$fromList || !$toList ) {
-                       $out = wfMsgWikiHtml( 'allpagesbadtitle' );
+                       $out = wfMsgExt( 'allpagesbadtitle', 'parse' );
                } elseif ( !in_array( $namespace, array_keys( $namespaces ) ) ) {
                        // Show errormessage and reset to NS_MAIN
                        $out = wfMsgExt( 'allpages-bad-ns', array( 'parseinline' ), $namespace );
index e556a60..bc21d92 100644 (file)
@@ -68,7 +68,7 @@ class EmailConfirmation extends UnlistedSpecialPage {
                                        array(),
                                        array( 'returnto' => $this->getTitle()->getPrefixedText() )
                                );
-                               $wgOut->addHTML( wfMsgWikiHtml( 'confirmemail_needlogin', $llink ) );
+                               $wgOut->addWikiMsgArray( 'confirmemail_needlogin', array( $llink ), array( 'replaceafter' ) );
                        }
                } else {
                        $this->attemptConfirm( $code );
index 09e7734..55309f3 100644 (file)
@@ -126,7 +126,7 @@ class SpecialPrefixindex extends SpecialAllpages {
                $namespaces = $wgContLang->getNamespaces();
 
                if ( !$prefixList || !$fromList ) {
-                       $out = wfMsgWikiHtml( 'allpagesbadtitle' );
+                       $out = wfMsgExt( 'allpagesbadtitle', 'parse' );
                } elseif ( !in_array( $namespace, array_keys( $namespaces ) ) ) {
                        // Show errormessage and reset to NS_MAIN
                        $out = wfMsgExt( 'allpages-bad-ns', array( 'parseinline' ), $namespace );
index 7c5849d..bb0325f 100644 (file)
@@ -821,28 +821,26 @@ class SpecialUndelete extends SpecialPage {
                } else {
                        $openDiv = '<div id="mw-undelete-revision">';
                }
+               $wgOut->addHTML( $openDiv );
 
                // Revision delete links
                $canHide = $wgUser->isAllowed( 'deleterevision' );
-               if( $this->mDiff ) {
-                       $revdlink = ''; // diffs already have revision delete links
-               } else if( $canHide || ($rev->getVisibility() && $wgUser->isAllowed('deletedhistory')) ) {
+               if ( !$this->mDiff && ( $canHide || ( $rev->getVisibility() && $wgUser->isAllowed( 'deletedhistory' ) ) ) ) {
                        if( !$rev->userCan(Revision::DELETED_RESTRICTED ) ) {
-                               $revdlink = $skin->revDeleteLinkDisabled( $canHide ); // revision was hidden from sysops
+                               $wgOut->addHTML( $skin->revDeleteLinkDisabled( $canHide ) ); // revision was hidden from sysops
                        } else {
                                $query = array(
                                        'type'   => 'archive',
                                        'target' => $this->mTargetObj->getPrefixedDBkey(),
                                        'ids'    => $rev->getTimestamp()
                                );
-                               $revdlink = $skin->revDeleteLink( $query,
-                                       $rev->isDeleted( File::DELETED_RESTRICTED ), $canHide );
+                               $wgOut->addHTML( $skin->revDeleteLink( $query,
+                                       $rev->isDeleted( File::DELETED_RESTRICTED ), $canHide ) );
                        }
-               } else {
-                       $revdlink = '';
                }
 
-               $wgOut->addHTML( $openDiv . $revdlink . wfMsgWikiHtml( 'undelete-revision', $link, $time, $user, $d, $t ) . '</div>' );
+               $wgOut->addWikiMsgArray( 'undelete-revision', array( $link, $time, $user, $d, $t ), array( 'replaceafter' ) );
+               $wgOut->addHTML( '</div>' );
                wfRunHooks( 'UndeleteShowRevision', array( $this->mTargetObj, $rev ) );
 
                if( $this->mPreview ) {
@@ -1116,7 +1114,7 @@ class SpecialUndelete extends SpecialPage {
                                Xml::openElement( 'table', array( 'id' => 'mw-undelete-table' ) ) .
                                        "<tr>
                                                <td colspan='2' class='mw-undelete-extrahelp'>" .
-                                                       wfMsgWikiHtml( 'undeleteextrahelp' ) .
+                                                       wfMsgExt( 'undeleteextrahelp', 'parse' ) .
                                                "</td>
                                        </tr>
                                        <tr>
@@ -1410,7 +1408,7 @@ class SpecialUndelete extends SpecialPage {
 
                                $skin = $wgUser->getSkin();
                                $link = $skin->linkKnown( $this->mTargetObj );
-                               $wgOut->addHTML( wfMsgWikiHtml( 'undeletedpage', $link ) );
+                               $wgOut->addWikiMsgArray( 'undeletedpage', array( $link ), array( 'replaceafter' ) );
                        } else {
                                $wgOut->showFatalError( wfMsg( "cannotundelete" ) );
                                $wgOut->addHTML( '<p>' . wfMsgHtml( "undeleterevdel" ) . '</p>' );
index e14dd19..8fb0899 100644 (file)
@@ -698,7 +698,7 @@ class SpecialUpload extends SpecialPage {
                                        'page' => $filename
                                )
                        );
-                       $warning = wfMsgWikiHtml( 'filewasdeleted', $llink );
+                       $warning = wfMsgExt( 'filewasdeleted', array( 'parse', 'replaceafter' ), $llink );
                }
 
                return $warning;
@@ -910,16 +910,16 @@ class UploadForm extends HTMLForm {
                                # Everything not permitted is banned
                                $extensionsList =
                                        '<div id="mw-upload-permitted">' .
-                                       wfMsgWikiHtml( 'upload-permitted', $wgLang->commaList( $wgFileExtensions ) ) .
+                                       wfMsgExt( 'upload-permitted', 'parse', $wgLang->commaList( $wgFileExtensions ) ) .
                                        "</div>\n";
                        } else {
                                # We have to list both preferred and prohibited
                                $extensionsList =
                                        '<div id="mw-upload-preferred">' .
-                                       wfMsgWikiHtml( 'upload-preferred', $wgLang->commaList( $wgFileExtensions ) ) .
+                                       wfMsgExt( 'upload-preferred', 'parse', $wgLang->commaList( $wgFileExtensions ) ) .
                                        "</div>\n" .
                                        '<div id="mw-upload-prohibited">' .
-                                       wfMsgWikiHtml( 'upload-prohibited', $wgLang->commaList( $wgFileBlacklist ) ) .
+                                       wfMsgExt( 'upload-prohibited', 'parse', $wgLang->commaList( $wgFileBlacklist ) ) .
                                        "</div>\n";
                        }
                } else {
index 63abc8f..0812bf7 100644 (file)
@@ -231,7 +231,7 @@ class LoginForm extends SpecialPage {
                        # Confirm that the account was created
                        $self = SpecialPage::getTitleFor( 'Userlogin' );
                        $wgOut->setPageTitle( wfMsgHtml( 'accountcreated' ) );
-                       $wgOut->addHTML( wfMsgWikiHtml( 'accountcreatedtext', $u->getName() ) );
+                       $wgOut->addWikiMsg( 'accountcreatedtext', $u->getName() );
                        $wgOut->returnToMain( false, $self );
                        wfRunHooks( 'AddNewAccount', array( $u, false ) );
                        $u->addNewUserLogEntry( false, $this->mReason );
@@ -680,7 +680,7 @@ class LoginForm extends SpecialPage {
                                break;
                        case self::NOT_EXISTS:
                                if( $wgUser->isAllowed( 'createaccount' ) ) {
-                                       $this->mainLoginForm( wfMsgWikiHtml( 'nosuchuser', htmlspecialchars( $this->mUsername ) ) );
+                                       $this->mainLoginForm( wfMsgExt( 'nosuchuser', 'parseinline', $this->mUsername ) );
                                } else {
                                        $this->mainLoginForm( wfMsg( 'nosuchusershort', htmlspecialchars( $this->mUsername ) ) );
                                }
@@ -775,7 +775,7 @@ class LoginForm extends SpecialPage {
                        return;
                }
                if ( 0 == $u->getID() ) {
-                       $this->mainLoginForm( wfMsgWikiHtml( 'nosuchuser', htmlspecialchars( $u->getName() ) ) );
+                       $this->mainLoginForm( wfMsgExt( 'nosuchuser', 'parseinline', $u->getName() ) );
                        return;
                }
 
index 3bd5d48..626038b 100644 (file)
@@ -57,12 +57,12 @@ function wfSpecialWatchlist( $par ) {
        if( $wgUser->isAnon() ) {
                $wgOut->setPageTitle( wfMsg( 'watchnologin' ) );
                $llink = $skin->linkKnown(
-                       SpecialPage::getTitleFor( 'Userlogin' ), 
+                       SpecialPage::getTitleFor( 'Userlogin' ),
                        wfMsgHtml( 'loginreqlink' ),
                        array(),
                        array( 'returnto' => $specialTitle->getPrefixedText() )
                );
-               $wgOut->addHTML( wfMsgWikiHtml( 'watchlistanontext', $llink ) );
+               $wgOut->addWikiMsgArray( 'watchlistanontext', array( $llink ), array( 'replaceafter' ) );
                return;
        }