Use wfMsg()'s parameters
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 13:26:37 +0000 (13:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 15 Nov 2003 13:26:37 +0000 (13:26 +0000)
includes/SpecialUserlogin.php
includes/SpecialWantedpages.php
includes/SpecialWatchlist.php

index 28d6d2d..062e7d0 100644 (file)
@@ -29,8 +29,7 @@ function wfSpecialUserlogin()
        global $wgOut, $wpEmail, $wpName;
        
        if ("" == $wpEmail) {
-               $m = str_replace( "$1", $wpName, wfMsg( "noemail" ) );
-               mainLoginForm( $m );
+               mainLoginForm( wfMsg( "noemail", $wpName ) );
                return;
        }
 
@@ -50,9 +49,7 @@ function wfSpecialUserlogin()
        $wgOut->setRobotpolicy( "noindex,nofollow" );
        $wgOut->setArticleFlag( false );
 
-       $m = str_replace( "$1", $u->getName(), wfMsg( "accmailtext" ) );
-       $m = str_replace( "$2", $u->getEmail(), $m );
-       $wgOut->addWikiText( $m );
+       $wgOut->addWikiText( wfMsg( "accmailtext", $u->getName(), $u->getEmail() ) );
        $wgOut->returnToMain( false );
 
        $u = 0;
@@ -71,8 +68,7 @@ function wfSpecialUserlogin()
        }
 
        $wgUser = $u;
-       $m = str_replace( "$1", $wgUser->getName(), wfMsg( "welcomecreation" ) );
-       successfulLogin( $m );
+       successfulLogin( wfMsg( "welcomecreation", $wgUser->getName() ) );
 }
 
 
@@ -133,8 +129,7 @@ function wfSpecialUserlogin()
        $u = User::newFromName( $wpName );
        $id = $u->idForName();
        if ( 0 == $id ) {
-               $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) );
-               mainLoginForm( $m );
+               mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) );
                return;
        }
        $u->setId( $id );
@@ -158,8 +153,7 @@ function wfSpecialUserlogin()
        $u->setOption( "rememberpassword", $r );
 
        $wgUser = $u;
-       $m = str_replace( "$1", $wgUser->getName(), wfMsg( "loginsuccess" ) );
-       successfulLogin( $m );
+       successfulLogin( wfMsg( "loginsuccess", $wgUser->getName() ) );
 }
 
 /* private */ function mailPassword()
@@ -174,8 +168,7 @@ function wfSpecialUserlogin()
        $u = User::newFromName( $wpName );
        $id = $u->idForName();
        if ( 0 == $id ) {
-               $m = str_replace( "$1", $u->getName(), wfMsg( "nosuchuser" ) );
-               mainLoginForm( $m );
+               mainLoginForm( wfMsg( "nosuchuser", $u->getName() ) );
                return;
        }
        $u->setId( $id );
@@ -185,8 +178,7 @@ function wfSpecialUserlogin()
                return;
        }
 
-       $m = str_replace( "$1", $u->getName(), wfMsg( "passwordsent" ) );
-       mainLoginForm( $m );
+       mainLoginForm( wfMsg( "passwordsent", $u->getName() ) );
 }
 
 
@@ -196,8 +188,7 @@ function wfSpecialUserlogin()
        global $wgPasswordSender;
 
        if ( "" == $u->getEmail() ) {
-               $m = str_replace( "$1", $u->getName(), wfMsg( "noemail" ) );
-               mainLoginForm( $m );
+               mainLoginForm( wfMsg( "noemail", $u->getName() ) );
                return;
        }
        $np = User::randomPassword();
@@ -209,9 +200,7 @@ function wfSpecialUserlogin()
        $ip = getenv( "REMOTE_ADDR" );
        if ( "" == $ip ) { $ip = "(Unknown)"; }
 
-       $m = str_replace( "$1", $ip, wfMsg( "passwordremindertext" ) );
-       $m = str_replace( "$2", $u->getName(), $m );
-       $m = str_replace( "$3", $np, $m );
+       $m = wfMsg( "passwordremindertext", $ip, $u->getName(), $np );
 
        mail( $u->getEmail(), wfMsg( "passwordremindertitle" ), $m,
          "MIME-Version: 1.0\r\n" .
index af8aac4..834d68c 100644 (file)
@@ -42,7 +42,7 @@ function wfSpecialWantedpages()
                $nt = Title::newFromDBkey( $obj->bl_to );
 
                $plink = $sk->makeBrokenLink( $nt->getPrefixedText(), "" );
-               $nl = str_replace( "$1", $obj->nlinks, wfMsg( "nlinks" ) );
+               $nl = wfMsg( "nlinks", $obj->nlinks );
                $nlink = $sk->makeKnownLink( $wgLang->specialPage(
                  "Whatlinkshere" ), $nl, "target=" . $nt->getPrefixedURL() );
 
index d49bfd4..e5749e1 100644 (file)
@@ -9,7 +9,7 @@ function wfSpecialWatchlist()
        $fname = "wfSpecialWatchlist";
 
        $wgOut->setPagetitle( wfMsg( "watchlist" ) );
-       $sub = str_replace( "$1", $wgUser->getName(), wfMsg( "watchlistsub" ) );
+       $sub = wfMsg( "watchlistsub", $wgUser->getName() );
        $wgOut->setSubtitle( $sub );
        $wgOut->setRobotpolicy( "noindex,nofollow" );