From 23807179790108fc2575d06df59dbaebf8ce0af8 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Sun, 6 Sep 2015 12:41:31 +0200 Subject: Bug 1194987: Editing your email address and make it point to a non-existent email address makes Bugzilla stop working r=gerv a=sgreen --- Bugzilla/Auth/Verify.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Auth/Verify.pm') diff --git a/Bugzilla/Auth/Verify.pm b/Bugzilla/Auth/Verify.pm index e44fb06ae..9dc83273b 100644 --- a/Bugzilla/Auth/Verify.pm +++ b/Bugzilla/Auth/Verify.pm @@ -106,21 +106,24 @@ sub create_or_update_user { my $user = new Bugzilla::User($user_id); - # Now that we have a valid User, we need to see if any data has to be - # updated. + # Now that we have a valid User, we need to see if any data has to be updated. + my $changed = 0; + if ($username && lc($user->login) ne lc($username)) { validate_email_syntax($username) || return { failure => AUTH_ERROR, error => 'auth_invalid_email', details => {addr => $username} }; $user->set_login($username); + $changed = 1; } if ($real_name && $user->name ne $real_name) { # $real_name is more than likely tainted, but we only use it # in a placeholder and we never use it after this. trick_taint($real_name); $user->set_name($real_name); + $changed = 1; } - $user->update(); + $user->update() if $changed; return { user => $user }; } -- cgit v1.2.3-24-g4f1b