email address validation: using strtolower() with equal-operator to check if address is not already in use, instead of comparing with LIKE-operator, fixes #1021

Signed-off-by: Arnold Bechtoldt <mail@arnoldbechtoldt.com>
This commit is contained in:
Arnold Bechtoldt
2012-05-29 10:21:58 +02:00
parent aa22d5c594
commit f957a0a04e

View File

@@ -237,7 +237,7 @@ elseif($page == 'emails')
standard_error('emailiswrong', $email_full);
}
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE (`email` LIKE '" . $db->escape($email) . "' OR `email_full` LIKE '" . $db->escape($email_full) . "') AND `customerid`='" . (int)$userinfo['customerid'] . "'");
$email_check = $db->query_first("SELECT `id`, `email`, `email_full`, `iscatchall`, `destination`, `customerid` FROM `" . TABLE_MAIL_VIRTUAL . "` WHERE (`email` = '" . strtolower($db->escape($email)) . "' OR `email_full` = '" . strtolower($db->escape($email_full)) . "') AND `customerid`='" . (int)$userinfo['customerid'] . "'");
if($email == ''
|| $email_full == ''
@@ -253,7 +253,7 @@ elseif($page == 'emails')
{
standard_error('maindomainnonexist', $domain);
}
elseif($email_check['email_full'] == $email_full)
elseif(strtolower($email_check['email_full']) == strtolower($email_full))
{
standard_error('emailexistalready', $email_full);
}