Index: trunk/phase3/includes/specials/SpecialInterwiki.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | |
66 | 66 | $actionUrl = $this->getTitle()->getLocalURL( 'action=submit' ); |
67 | 67 | $token = $wgUser->editToken(); |
68 | | - $defaultreason = $wgRequest->getVal( 'wpInterwikiReason' ) ? $wgRequest->getVal( 'wpInterwikiReason' ) : wfMsgForContent( 'interwiki_defaultreason' ); |
| 68 | + $defaultreason = $wgRequest->getVal( 'wpInterwikiReason', wfMsgForContent( 'interwiki_defaultreason' ) ); |
69 | 69 | |
70 | 70 | switch( $action ){ |
71 | 71 | case "delete": |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | $dbr = wfGetDB( DB_SLAVE ); |
104 | 104 | $row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ) ); |
105 | 105 | if( !$row ){ |
106 | | - $this->error( wfMsg( 'interwiki_editerror', $prefix ) ); |
| 106 | + $this->error( 'interwiki_editerror', $prefix ); |
107 | 107 | return; |
108 | 108 | } |
109 | 109 | $prefix = '<tt>' . htmlspecialchars( $row->iw_prefix ) . '</tt>'; |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | $prefix = $wgRequest->getVal( 'wpInterwikiPrefix' ); |
166 | 166 | $do = $wgRequest->getVal( 'wpInterwikiAction' ); |
167 | 167 | if( preg_match( '/[\s:&=]/', $prefix ) ) { |
168 | | - $this->error( wfMsg( 'interwiki-badprefix', $prefix ) ); |
| 168 | + $this->error( 'interwiki-badprefix', htmlspecialchars( $prefix ) ); |
169 | 169 | $this->showForm( $do ); |
170 | 170 | return; |
171 | 171 | } |
— | — | @@ -176,7 +176,7 @@ |
177 | 177 | $dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ ); |
178 | 178 | |
179 | 179 | if ( $dbw->affectedRows() == 0 ) { |
180 | | - $this->error( wfMsg( 'interwiki_delfailed', $prefix ) ); |
| 180 | + $this->error( 'interwiki_delfailed', $prefix ); |
181 | 181 | $this->showForm( $do ); |
182 | 182 | } else { |
183 | 183 | $wgOut->addWikiText( wfMsg( 'interwiki_deleted', $prefix )); |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | } |
202 | 202 | |
203 | 203 | if( $dbw->affectedRows() == 0 ) { |
204 | | - $this->error( wfMsg( "interwiki_{$do}failed", $prefix ) ); |
| 204 | + $this->error( "interwiki_{$do}failed", $prefix ); |
205 | 205 | $this->showForm( $do ); |
206 | 206 | } else { |
207 | 207 | $wgOut->addWikiMsg( "interwiki_{$do}ed", $prefix ); |
— | — | @@ -233,7 +233,7 @@ |
234 | 234 | $res = $dbr->select( 'interwiki', '*' ); |
235 | 235 | $numrows = $res->numRows(); |
236 | 236 | if ( $numrows == 0 ) { |
237 | | - $this->error( wfMsgWikiHtml( 'interwiki_error' ) ); |
| 237 | + $this->error( 'interwiki_error' ); |
238 | 238 | return; |
239 | 239 | } |
240 | 240 | |
— | — | @@ -275,8 +275,9 @@ |
276 | 276 | $wgOut->addHTML( $out ); |
277 | 277 | } |
278 | 278 | |
279 | | - function error( $msg ) { |
| 279 | + function error() { |
280 | 280 | 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 ); |
282 | 283 | } |
283 | 284 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2196,7 +2196,7 @@ |
2197 | 2197 | 'interwiki_addintro' => 'You are adding a new interwiki prefix. |
2198 | 2198 | Remember that it cannot contain spaces ( ), colons (:), ampersands (&), or equal signs (=).', |
2199 | 2199 | 'interwiki_addtext' => 'Add an interwiki prefix', |
2200 | | -'interwiki-badprefix' => '"$1" contains invalid characters', |
| 2200 | +'interwiki-badprefix' => 'Specified interwiki prefix "$1" contains invalid characters', |
2201 | 2201 | 'interwiki_defaultreason' => 'no reason given', |
2202 | 2202 | 'interwiki_defaulturl' => 'http://www.example.com/$1', # only translate this message to other languages if you have to change it |
2203 | 2203 | 'interwiki_deleted' => 'Prefix "$1" was successfully removed from the interwiki table.', |