r47238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47237‎ | r47238 | r47239 >
Date:23:33, 13 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
Use addWikiMsg()
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser_body.php
@@ -117,7 +117,7 @@
118118 }
119119 }
120120 # Add CIDR calculation convenience form
121 - $wgOut->addHTML( $this->addJsCIDRForm() );
 121+ $this->addJsCIDRForm();
122122 $this->addStyles();
123123 }
124124
@@ -221,6 +221,7 @@
222222 * Make a quick JS form for admins to calculate block ranges
223223 */
224224 protected function addJsCIDRForm() {
 225+ global $wgOut;
225226 $s = '<fieldset id="mw-checkuser-cidrform" style="display:none;">'.
226227 '<legend>'.wfMsgHtml('checkuser-cidr-label').'</legend>';
227228 $s .= '<textarea id="mw-checkuser-iplist" rows="5" cols="50" onkeyup="updateCIDRresult()" onclick="updateCIDRresult()"></textarea><br/>';
@@ -228,7 +229,7 @@
229230 Xml::input( 'mw-checkuser-cidr-res',35,'',array('id'=>'mw-checkuser-cidr-res') ) .
230231 '<span id="mw-checkuser-ipnote"></span>';
231232 $s .= '</fieldset>';
232 - return $s;
 233+ $wgOut->addHTML( $s );
233234 }
234235
235236 /**
@@ -314,8 +315,7 @@
315316 }
316317 # IPs are passed in as a blank string
317318 if( !$user ) {
318 - $s = wfMsgHtml('nouserspecified');
319 - $wgOut->addHTML( $s );
 319+ $wgOut->addWikiMsg( 'nouserspecified' );
320320 return;
321321 }
322322 # Get ID, works better than text as user may have been renamed
@@ -323,7 +323,7 @@
324324
325325 # If user is not IP or nonexistent
326326 if( !$user_id ) {
327 - $s = wfMsgExt('nosuchusershort',array('parseinline'),$user);
 327+ $s = wfMsgExt('nosuchusershort',array('parse'),$user);
328328 $wgOut->addHTML( $s );
329329 return;
330330 }
@@ -439,8 +439,7 @@
440440 $fname = 'CheckUser::doIPEditsRequest';
441441 # Invalid IPs are passed in as a blank string
442442 if(!$ip) {
443 - $s = wfMsgHtml('badipaddress');
444 - $wgOut->addHTML( $s );
 443+ $wgOut->addWikiMsg( 'badipaddress' );
445444 return;
446445 }
447446
@@ -450,7 +449,7 @@
451450 }
452451 # Record check...
453452 if( !$this->addLogEntry( $logType, 'ip', $ip, $reason ) ) {
454 - $wgOut->addHTML( '<p>'.wfMsgHtml('checkuser-log-fail').'</p>' );
 453+ $wgOut->addWikiMsg( 'checkuser-log-fail' );
455454 }
456455
457456 $dbr = wfGetDB( DB_SLAVE );
@@ -581,8 +580,7 @@
582581 }
583582 # IPs are passed in as a blank string
584583 if( !$user ) {
585 - $s = wfMsgHtml('nouserspecified');
586 - $wgOut->addHTML( $s );
 584+ $wgOut->addWikiMsg( 'nouserspecified' );
587585 return;
588586 }
589587 # Get ID, works better than text as user may have been renamed
@@ -590,7 +588,7 @@
591589
592590 # If user is not IP or nonexistent
593591 if( !$user_id ) {
594 - $s = wfMsgExt('nosuchusershort',array('parseinline'),$user);
 592+ $s = wfMsgExt('nosuchusershort',array('parse'),$user);
595593 $wgOut->addHTML( $s );
596594 return;
597595 }
@@ -705,8 +703,7 @@
706704
707705 # Invalid IPs are passed in as a blank string
708706 if( !$ip ) {
709 - $s = wfMsgHtml('badipaddress');
710 - $wgOut->addHTML( $s );
 707+ $wgOut->addWikiMsg( 'badipaddress' );
711708 return;
712709 }
713710

Status & tagging log