summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-03 12:12:31 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-03-03 12:12:31 +0000
commit104c532e947afd11f51cfa33666dda64449e724d (patch)
treecdb288c2ede1abce9343d60819366247fcee1e18 /roundcubemail/program
parent39e347ed53c24c87c7d74266306c986830e09ade (diff)
- Fix long e-mail addresses validation (#1486453)
git-svn-id: https://svn.roundcube.net/trunk@3311 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/main.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 9cf6dd00c..da588b240 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -1511,8 +1511,12 @@ function check_email($email)
if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $email))
return false;
- // Check that there's one @ symbol, and that the lengths are right
- if (!preg_match('/^([^@]{1,64})@([^@]{1,255})$/', $email, $email_array))
+ // Check for length limit specified by RFC 5321 (#1486453)
+ if (strlen($email) > 254)
+ return false;
+
+ // Check that there's one @ symbol
+ if (!preg_match('/^([^@]+)@([^@]+)$/', $email, $email_array))
return false;
// Check local part