From d25bf51dc095952700e139bbdcdeec0400b2252d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 22 Apr 2008 23:47:27 +0000 Subject: [PATCH] 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. --- includes/User.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(), -- 2.20.1