r39668 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39667‎ | r39668 | r39669 >
Date:22:25, 19 August 2008
Author:brion
Status:old
Tags:
Comment:
reapply 39647; reverted wrong one
Modified paths:
  • /trunk/extensions/CheckUser/CheckUser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CheckUser/CheckUser.php
@@ -158,12 +158,13 @@
159159 */
160160 function efUpdateCUEmailData( $to, $from, $subject, $text ) {
161161 global $wgSecretKey;
162 - if( !$wgSecretKey ) {
 162+ if( !$wgSecretKey || $from->name == $to->name ) {
163163 return true;
164164 }
165165 wfLoadExtensionMessages( 'CheckUser' );
166 - $user = User::newFromName( $to->name );
167 - $hash = md5( $user->getEmail() . $user->getId() . $wgSecretKey );
 166+ $userFrom = User::newFromName( $from->name );
 167+ $userTo = User::newFromName( $to->name );
 168+ $hash = md5( $userTo->getEmail() . $userTo->getId() . $wgSecretKey );
168169 // Get IP
169170 $ip = wfGetIP();
170171 // Get XFF header
@@ -181,8 +182,8 @@
182183 'cuc_namespace' => NS_USER,
183184 'cuc_title' => '',
184185 'cuc_minor' => 0,
185 - 'cuc_user' => $user->getId(),
186 - 'cuc_user_text' => $user->getName(),
 186+ 'cuc_user' => $userFrom->getId(),
 187+ 'cuc_user_text' => $userFrom->getName(),
187188 'cuc_actiontext' => wfMsgForContent('checkuser-email-action',$hash),
188189 'cuc_comment' => '',
189190 'cuc_this_oldid' => 0,

Status & tagging log