From: Brion Vibber Date: Tue, 22 Apr 2008 23:47:27 +0000 (+0000) Subject: Fix regression with confirmation e-mails sent via Special:Confirmemail. X-Git-Tag: 1.31.0-rc.0~48123 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=d25bf51dc095952700e139bbdcdeec0400b2252d;p=lhc%2Fweb%2Fwiklou.git Fix regression with confirmation e-mails sent via Special:Confirmemail. Recent changes to User object made User::sendConfirmationEmail() *not* save the new confirmation token to the database, which seems rather odd. As a result, you got a mail with a bogus value. Since the function has side-effects, it pretty clearly needs to be saving its changes. Went ahead and had it do that rather than forcing all callers to fix its internal failing. --- diff --git a/includes/User.php b/includes/User.php index 9ad7e18733..7897c3c173 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2461,8 +2461,8 @@ class User { * Generate a new e-mail confirmation token and send a confirmation/invalidation * mail to the user's given address. * - * Call saveSettings() after calling this function to commit the confirmation - * token to the database. + * Calls saveSettings() internally; as it has side effects, not committing changes + * would be pretty silly. * * @return mixed True on success, a WikiError object on failure. */ @@ -2472,6 +2472,8 @@ class User { $token = $this->confirmationToken( $expiration ); $url = $this->confirmationTokenUrl( $token ); $invalidateURL = $this->invalidationTokenUrl( $token ); + $this->saveSettings(); + return $this->sendMail( wfMsg( 'confirmemail_subject' ), wfMsg( 'confirmemail_body', wfGetIP(),