Index: trunk/extensions/CheckUser/CheckUser.php |
— | — | @@ -201,13 +201,12 @@ |
202 | 202 | */ |
203 | 203 | function efUpdateCUEmailData( $to, $from, $subject, $text ) { |
204 | 204 | global $wgSecretKey; |
205 | | - if( !$wgSecretKey || $from->name == $to->name ) { |
| 205 | + if( !$wgSecretKey ) { |
206 | 206 | return true; |
207 | 207 | } |
208 | 208 | wfLoadExtensionMessages( 'CheckUser' ); |
209 | | - $userFrom = User::newFromName( $from->name ); |
210 | | - $userTo = User::newFromName( $to->name ); |
211 | | - $hash = md5( $userTo->getEmail() . $userTo->getId() . $wgSecretKey ); |
| 209 | + $user = User::newFromName( $to->name ); |
| 210 | + $hash = md5( $user->getEmail() . $user->getId() . $wgSecretKey ); |
212 | 211 | // Get IP |
213 | 212 | $ip = wfGetIP(); |
214 | 213 | // Get XFF header |
— | — | @@ -225,8 +224,8 @@ |
226 | 225 | 'cuc_namespace' => NS_USER, |
227 | 226 | 'cuc_title' => '', |
228 | 227 | 'cuc_minor' => 0, |
229 | | - 'cuc_user' => $userFrom->getId(), |
230 | | - 'cuc_user_text' => $userFrom->getName(), |
| 228 | + 'cuc_user' => $user->getId(), |
| 229 | + 'cuc_user_text' => $user->getName(), |
231 | 230 | 'cuc_actiontext' => wfMsgForContent('checkuser-email-action',$hash), |
232 | 231 | 'cuc_comment' => '', |
233 | 232 | 'cuc_this_oldid' => 0, |