From e88ea173e8d1826ce33c834e704d04dde91331c4 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Thu, 2 Jan 2014 20:02:34 +0100 Subject: [PATCH] Fix alias overriding bug when changing names When changing name (first name or last name), the new alias was tested against existing aliases in email_source_account table but not against those in email_source_other, where the homonyms are. Signed-off-by: Nicolas Iooss --- include/validations/names.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/validations/names.inc.php b/include/validations/names.inc.php index d52a849..34e0567 100644 --- a/include/validations/names.inc.php +++ b/include/validations/names.inc.php @@ -59,6 +59,13 @@ class NamesReq extends ProfileValidate FROM email_source_account WHERE email = {?} AND type != \'alias_aux\'', $this->new_alias); + if (!$used) { + // Check against homonyms + $used = XDB::fetchOneCell('SELECT COUNT(email) + FROM email_source_other + WHERE email = {?}', + $this->new_alias); + } if ($used) { $this->new_alias = null; } -- 2.1.4