r80890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80889‎ | r80890 | r80891 >
Date:18:16, 24 January 2011
Author:ialex
Status:deferred
Tags:
Comment:
Use wfMsg() instead of $wgMessageCache->get()
Modified paths:
  • /trunk/extensions/SendmailToWiki/SendmailToWiki.php (modified) (history)
  • /trunk/extensions/SendmailToWiki/SendmailToWiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SendmailToWiki/SendmailToWiki_body.php
@@ -97,9 +97,7 @@
9898 function sendError($code, $message, $sendback = false) {
9999 if (!$sendback)
100100 return;
101 -
102 - global $wgMessageCache, $wgParser;
103 -
 101+
104102 switch ($code) {
105103 case 400: header('HTTP/1.1 400 Bad Request'); break;
106104 case 403: header('HTTP/1.1 403 Forbidden'); break;
@@ -107,10 +105,10 @@
108106 }
109107
110108 $out = '';
111 - $out .= "<h1>".$wgMessageCache->get('errorpagetitle').": $code</h1>\n";
112 - $out .= "<h2>".$wgMessageCache->get($message)."</h2>\n";
 109+ $out .= "<h1>".wfMsg( 'errorpagetitle' ).": $code</h1>\n";
 110+ $out .= "<h2>".wfMsg( $message )."</h2>\n";
113111
114 - echo $wgParser->replaceVariables($out);
 112+ echo $out;
115113 }
116114 }
117115
Index: trunk/extensions/SendmailToWiki/SendmailToWiki.php
@@ -30,9 +30,8 @@
3131 $sendmailtowikiPrefix = 'wikipost';
3232
3333 function sendmailtowikiPinValidate( $value, $alldata ) {
34 - global $wgMessageCache;
3534 if ($value != '' && strlen($value) != 5)
36 - return $wgMessageCache->get('sendmailtowiki-err-pinlength');
 35+ return wfMsg( 'sendmailtowiki-err-pinlength' );
3736 return true;
3837 }
3938

Status & tagging log