summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-03 12:12:31 +0000
committeralecpl <alec@alec.pl>2010-03-03 12:12:31 +0000
commitaba0927545d3bd9998cbcf6bbc2a0b6bfd8d0318 (patch)
tree9a092523eb4f7e807f8e4ba903ce88e3dc14bf49
parent7910c0ff55edcb9ed973abd680489b9e0f28d0cb (diff)
- Fix long e-mail addresses validation (#1486453)
-rw-r--r--CHANGELOG1
-rw-r--r--program/include/main.inc8
2 files changed, 7 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2d1e02016..74fa86039 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix long e-mail addresses validation (#1486453)
- Remember search modifiers in user prefs (#1486146)
- Added force_7bit option to force MIME encoding of plain/text messages (#1486510)
- Use case sensitive check when checking for default folders (#1486346)
diff --git a/program/include/main.inc b/program/include/main.inc
index 9cf6dd00c..da588b240 100644
--- a/program/include/main.inc
+++ b/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