From d9e0d333634dc349893cd2642f4230e17ef52645 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 15 Nov 2003 14:21:29 +0000 Subject: [PATCH] Use wfMsg()'s parameters --- includes/DifferenceEngine.php | 12 +++++------- includes/EditPage.php | 16 ++++++---------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 26c09ca1f9..712690c5f2 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -18,7 +18,7 @@ class DifferenceEngine { $t = $wgTitle->getPrefixedText() . " (Diff: {$this->mOldid}, " . "{$this->mNewid})"; - $mtext = str_replace( "$1", $t, wfMsg( "missingarticle" ) ); + $mtext = wfMsg( "missingarticle", $t ); $wgOut->setArticleFlag( false ); if ( ! $this->loadText() ) { @@ -91,8 +91,7 @@ cellpadding=0 cellspacing='4px'> $this->mNewtext = $s->old_text; $t = $wgLang->timeanddate( $s->old_timestamp, true ); - $this->mNewtitle = str_replace( "$1", "{$t}", - wfMsg( "revisionasof" ) ); + $this->mNewtitle = wfMsg( "revisionasof", $t ); } if ( 0 == $this->mOldid ) { $sql = "SELECT old_timestamp,old_text FROM old USE INDEX (name_title_timestamp) WHERE " . @@ -111,8 +110,7 @@ cellpadding=0 cellspacing='4px'> $this->mOldtext = $s->old_text; $t = $wgLang->timeanddate( $s->old_timestamp, true ); - $this->mOldtitle = str_replace( "$1", "{$t}", - wfMsg( "revisionasof" ) ); + $this->mOldtitle = wfMsg( "revisionasof", $t ); return true; } @@ -1059,8 +1057,8 @@ class TableDiffFormatter extends DiffFormatter } function _block_header( $xbeg, $xlen, $ybeg, $ylen ) { - $l1 = str_replace( "$1", $xbeg, wfMsg( "lineno" ) ); - $l2 = str_replace( "$1", $ybeg, wfMsg( "lineno" ) ); + $l1 = wfMsg( "lineno", $xbeg ); + $l2 = wfMsg( "lineno", $ybeg ); $r = "{$l1}\n" . "{$l2}\n"; diff --git a/includes/EditPage.php b/includes/EditPage.php index f85a42420b..43aafdf368 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -171,8 +171,7 @@ class EditPage { $wgOut->setArticleFlag( false ); if ( $isConflict ) { - $s = str_replace( "$1", $this->mTitle->getPrefixedText(), - wfMsg( "editconflict" ) ); + $s = wfMsg( "editconflict", $this->mTitle->getPrefixedText() ); $wgOut->setPageTitle( $s ); $wgOut->addHTML( wfMsg( "explainconflict" ) ); @@ -180,8 +179,7 @@ class EditPage { $wpTextbox1 = $this->mArticle->getContent(true); $wpEdittime = $this->mArticle->getTimestamp(); } else { - $s = str_replace( "$1", $this->mTitle->getPrefixedText(), - wfMsg( "editing" ) ); + $s = wfMsg( "editing", $this->mTitle->getPrefixedText() ); if($section!="") { if($section=="new") { @@ -210,7 +208,7 @@ class EditPage { $kblength = (int)(strlen( $wpTextbox1 ) / 1024); if( $kblength > 29 ) { $wgOut->addHTML( "" . - str_replace( '$1', $kblength , wfMsg( "longpagewarning" ) ) + wfMsg( "longpagewarning", $kblength ) . "" ); } @@ -236,8 +234,8 @@ class EditPage { wfMsg( "cancel" ) ); $edithelp = $sk->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) ); - $copywarn = str_replace( "$1", $sk->makeKnownLink( - wfMsg( "copyrightpage" ) ), wfMsg( "copyrightwarning" ) ); + $copywarn = wfMsg( "copyrightwarning", $sk->makeKnownLink( + wfMsg( "copyrightpage" ) ) ); $wpTextbox1 = wfEscapeHTML( $wpTextbox1 ); $wpTextbox2 = wfEscapeHTML( $wpTextbox2 ); @@ -343,9 +341,7 @@ $wgLang->recodeForEdit( $wpTextbox1 ) . $link = "[[" . $wgLang->getNsText( Namespace::getUser() ) . ":{$name}|{$name}]]"; - $text = str_replace( "$1", $link, wfMsg( "blockedtext" ) ); - $text = str_replace( "$2", $reason, $text ); - $wgOut->addWikiText( $text ); + $wgOut->addWikiText( wfMsg( "blockedtext", $link, $reason ) ); $wgOut->returnToMain( false ); } -- 2.20.1