From f957a0a04e34b56367791f5864b61e5acac424b7 Mon Sep 17 00:00:00 2001 From: Arnold Bechtoldt Date: Tue, 29 May 2012 10:21:58 +0200 Subject: [PATCH] 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 --- customer_email.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/customer_email.php b/customer_email.php index c0198d1b..dedcc32e 100644 --- a/customer_email.php +++ b/customer_email.php @@ -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); }