From def0193f313521c499378e1e7ae294161e31f6f0 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 15 Nov 2003 14:11:30 +0000 Subject: [PATCH] Use wfMsg()'s parameters --- includes/DatabaseFunctions.php | 4 ++-- includes/ImagePage.php | 3 +-- includes/SearchEngine.php | 2 +- includes/Skin.php | 8 ++++---- includes/SpecialBlockip.php | 4 ++-- includes/SpecialContributions.php | 3 +-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/includes/DatabaseFunctions.php b/includes/DatabaseFunctions.php index a61de965ca..3c1ce5ac19 100644 --- a/includes/DatabaseFunctions.php +++ b/includes/DatabaseFunctions.php @@ -14,8 +14,8 @@ function wfGetDB( $altuser = "", $altpassword = "", $altserver = "", $altdb = "" global $wgDBserver, $wgDBuser, $wgDBpassword; global $wgDBname, $wgDBconnection, $wgEmergencyContact; - $noconn = str_replace( "$1", $wgDBserver, wfMsgNoDB( "noconnect" ) ); - $nodb = str_replace( "$1", $wgDBname, wfMsgNoDB( "nodb" ) ); + $noconn = wfMsgNoDB( "noconnect", $wgDBserver ); + $nodb = wfMsgNoDB( "nodb", $wgDBname ); $helpme = "\n

If this error persists after reloading and clearing " . "your browser cache, please notify the addHTML( "

" . $text ); $wgOut->returnToMain( false ); diff --git a/includes/SearchEngine.php b/includes/SearchEngine.php index 6739bf59a1..7735318eb6 100644 --- a/includes/SearchEngine.php +++ b/includes/SearchEngine.php @@ -352,7 +352,7 @@ class SearchEngine { if ( "" == $contextchars ) { $contextchars = 50; } $link = $sk->makeKnownLink( $t, "" ); - $size = str_replace( "$1", strlen( $row->cur_text ), WfMsg( "nbytes" ) ); + $size = wfMsg( "nbytes", strlen( $row->cur_text ) ); $wgOut->addHTML( "

  • {$link} ({$size})" ); $lines = explode( "\n", $row->cur_text ); diff --git a/includes/Skin.php b/includes/Skin.php index 0783fb70b6..fa156bec71 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -437,7 +437,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) $tl = $this->makeKnownLink( $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}", wfMsg("newmessageslink") ); - $s.=" | ". str_replace( "$1", $tl, wfMsg("newmessages") ) . ""; + $s.=" | ". wfMsg( "newmessages", $tl ) . ""; } } if( $wgUser->isSysop() && @@ -646,7 +646,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) $s = ""; } else { $count = $wgArticle->getCount(); - $s = str_replace( "$1", $count, wfMsg( "viewcount" ) ); + $s = wfMsg( "viewcount", $count ); } $s .= $this->lastModified(); $s .= " " . wfMsg( "gnunote" ); @@ -658,7 +658,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) global $wgLang, $wgArticle; $d = $wgLang->timeanddate( $wgArticle->getTimestamp(), true ); - $s = " " . str_replace( "$1", $d, wfMsg( "lastmodified" ) ); + $s = " " . wfMsg( "lastmodified", $d ); return $s; } @@ -1840,7 +1840,7 @@ if ( isset ( $wgUseApproval ) && $wgUseApproval ) else { $ul = $this->makeLink( $wgLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut ); } - $nb = str_replace( "$1", $size, wfMsg( "nbytes" ) ); + $nb = wfMsg( "nbytes", $size ); $style = $this->getInternalLinkAttributes( $url, $dt ); $s = "
  • ({$dlink}) ({$rlink}) {$dt}" diff --git a/includes/SpecialBlockip.php b/includes/SpecialBlockip.php index 5ce5ebf9f6..f03e535db3 100644 --- a/includes/SpecialBlockip.php +++ b/includes/SpecialBlockip.php @@ -91,7 +91,7 @@ class IPBlockForm { # Make log entry $log = new LogPage( wfMsg( "blocklogpage" ), wfMsg( "blocklogtext" ) ); - $action = str_replace( "$1", $wpBlockAddress, wfMsg( "blocklogentry" ) ); + $action = wfMsg( "blocklogentry", $wgBlockAddress ); $log->addEntry( $action, $wpBlockReason ); # Report to the user @@ -107,7 +107,7 @@ class IPBlockForm { $wgOut->setPagetitle( wfMsg( "blockip" ) ); $wgOut->setSubtitle( wfMsg( "blockipsuccesssub" ) ); - $text = str_replace( "$1", $ip, wfMsg( "blockipsuccesstext" ) ); + $text = wfMsg( "blockipsuccesstext", $ip ); $wgOut->addWikiText( $text ); } } diff --git a/includes/SpecialContributions.php b/includes/SpecialContributions.php index 32b8453ab3..6719274393 100644 --- a/includes/SpecialContributions.php +++ b/includes/SpecialContributions.php @@ -28,8 +28,7 @@ function wfSpecialContributions( $par = "" ) else { $ul = $sk->makeKnownLink( $nt->getPrefixedText(), $nt->getText() ); } - $sub = str_replace( "$1", $ul, wfMsg( "contribsub" ) ); - $wgOut->setSubtitle( $sub ); + $wgOut->setSubtitle( wfMsg( "contribsub", $ul ) ); if ( ! isset( $hideminor ) ) { $hideminor = $wgUser->getOption( "hideminor" ); -- 2.20.1