r45115 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45114‎ | r45115 | r45116 >
Date:03:14, 28 December 2008
Author:mrzman
Status:deferred
Tags:
Comment:
cleanup to r45102 per Nikerabbit on CodeReview
Modified paths:
  • /trunk/phase3/includes/specials/SpecialInterwiki.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialInterwiki.php
@@ -64,7 +64,7 @@
6565
6666 $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' );
6767 $token = $wgUser->editToken();
68 - $defaultreason = $wgRequest->getVal( 'wpInterwikiReason' ) ? $wgRequest->getVal( 'wpInterwikiReason' ) : wfMsgForContent( 'interwiki_defaultreason' );
 68+ $defaultreason = $wgRequest->getVal( 'wpInterwikiReason', wfMsgForContent( 'interwiki_defaultreason' ) );
6969
7070 switch( $action ){
7171 case "delete":
@@ -102,7 +102,7 @@
103103 $dbr = wfGetDB( DB_SLAVE );
104104 $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ) );
105105 if( !$row ){
106 - $this->error( wfMsg( 'interwiki_editerror', $prefix ) );
 106+ $this->error( 'interwiki_editerror', $prefix );
107107 return;
108108 }
109109 $prefix = '<tt>' . htmlspecialchars( $row->iw_prefix ) . '</tt>';
@@ -164,7 +164,7 @@
165165 $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' );
166166 $do = $wgRequest->getVal( 'wpInterwikiAction' );
167167 if( preg_match( '/[\s:&=]/', $prefix ) ) {
168 - $this->error( wfMsg( 'interwiki-badprefix', $prefix ) );
 168+ $this->error( 'interwiki-badprefix', htmlspecialchars( $prefix ) );
169169 $this->showForm( $do );
170170 return;
171171 }
@@ -176,7 +176,7 @@
177177 $dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ );
178178
179179 if ( $dbw->affectedRows() == 0 ) {
180 - $this->error( wfMsg( 'interwiki_delfailed', $prefix ) );
 180+ $this->error( 'interwiki_delfailed', $prefix );
181181 $this->showForm( $do );
182182 } else {
183183 $wgOut->addWikiText( wfMsg( 'interwiki_deleted', $prefix ));
@@ -200,7 +200,7 @@
201201 }
202202
203203 if( $dbw->affectedRows() == 0 ) {
204 - $this->error( wfMsg( "interwiki_{$do}failed", $prefix ) );
 204+ $this->error( "interwiki_{$do}failed", $prefix );
205205 $this->showForm( $do );
206206 } else {
207207 $wgOut->addWikiMsg( "interwiki_{$do}ed", $prefix );
@@ -233,7 +233,7 @@
234234 $res = $dbr->select( 'interwiki', '*' );
235235 $numrows = $res->numRows();
236236 if ( $numrows == 0 ) {
237 - $this->error( wfMsgWikiHtml( 'interwiki_error' ) );
 237+ $this->error( 'interwiki_error' );
238238 return;
239239 }
240240
@@ -275,8 +275,9 @@
276276 $wgOut->addHTML( $out );
277277 }
278278
279 - function error( $msg ) {
 279+ function error() {
280280 global $wgOut;
281 - $wgOut->addHTML( Xml::tags( 'p', array( 'class' => 'error' ), $msg ) );
 281+ $args = func_get_args();
 282+ $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args );
282283 }
283284 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2196,7 +2196,7 @@
21972197 'interwiki_addintro' => 'You are adding a new interwiki prefix.
21982198 Remember that it cannot contain spaces ( ), colons (:), ampersands (&), or equal signs (=).',
21992199 'interwiki_addtext' => 'Add an interwiki prefix',
2200 -'interwiki-badprefix' => '"$1" contains invalid characters',
 2200+'interwiki-badprefix' => 'Specified interwiki prefix "$1" contains invalid characters',
22012201 'interwiki_defaultreason' => 'no reason given',
22022202 'interwiki_defaulturl' => 'http://www.example.com/$1', # only translate this message to other languages if you have to change it
22032203 'interwiki_deleted' => 'Prefix "$1" was successfully removed from the interwiki table.',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45102more Special:Interwiki cleanup:...mrzman20:02, 27 December 2008

Status & tagging log