Index: trunk/extensions/CheckUser/CheckUser.php |
— | — | @@ -158,12 +158,13 @@ |
159 | 159 | */ |
160 | 160 | function efUpdateCUEmailData( $to, $from, $subject, $text ) { |
161 | 161 | global $wgSecretKey; |
162 | | - if( !$wgSecretKey ) { |
| 162 | + if( !$wgSecretKey || $from->name == $to->name ) { |
163 | 163 | return true; |
164 | 164 | } |
165 | 165 | 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 ); |
168 | 169 | // Get IP |
169 | 170 | $ip = wfGetIP(); |
170 | 171 | // Get XFF header |
— | — | @@ -181,8 +182,8 @@ |
182 | 183 | 'cuc_namespace' => NS_USER, |
183 | 184 | 'cuc_title' => '', |
184 | 185 | '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(), |
187 | 188 | 'cuc_actiontext' => wfMsgForContent('checkuser-email-action',$hash), |
188 | 189 | 'cuc_comment' => '', |
189 | 190 | 'cuc_this_oldid' => 0, |