r39647 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39646‎ | r39647 | r39648 >
Date:16:26, 19 August 2008
Author:aaron
Status:old
Tags:
Comment:
bug fixes
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser.php
@@ -201,12 +201,13 @@
202202 */
203203 function efUpdateCUEmailData( $to, $from, $subject, $text ) {
204204 global $wgSecretKey;
205 - if( !$wgSecretKey ) {
 205+ if( !$wgSecretKey || $from->name == $to->name ) {
206206 return true;
207207 }
208208 wfLoadExtensionMessages( 'CheckUser' );
209 - $user = User::newFromName( $to->name );
210 - $hash = md5( $user->getEmail() . $user->getId() . $wgSecretKey );
 209+ $userFrom = User::newFromName( $from->name );
 210+ $userTo = User::newFromName( $to->name );
 211+ $hash = md5( $userTo->getEmail() . $userTo->getId() . $wgSecretKey );
211212 // Get IP
212213 $ip = wfGetIP();
213214 // Get XFF header
@@ -224,8 +225,8 @@
225226 'cuc_namespace' => NS_USER,
226227 'cuc_title' => '',
227228 'cuc_minor' => 0,
228 - 'cuc_user' => $user->getId(),
229 - 'cuc_user_text' => $user->getName(),
 229+ 'cuc_user' => $userFrom->getId(),
 230+ 'cuc_user_text' => $userFrom->getName(),
230231 'cuc_actiontext' => wfMsgForContent('checkuser-email-action',$hash),
231232 'cuc_comment' => '',
232233 'cuc_this_oldid' => 0,

Follow-up revisions

RevisionCommit summaryAuthorDate
r39666Revert r39647 -- doesn't work, parameter is a User object not a name....brion22:22, 19 August 2008

Status & tagging log