From: Marcus Campbell Date: Mon, 8 Jan 2007 07:26:37 +0000 (+0000) Subject: * Updated isValidEmail regex to match plussed addresses X-Git-Url: https://projects.mako.cc/source/scuttle/commitdiff_plain/270046795d391a18ef69609b317febe8aec6facb * Updated isValidEmail regex to match plussed addresses --- diff --git a/services/userservice.php b/services/userservice.php index 1e7ed46..82abaf0 100644 --- a/services/userservice.php +++ b/services/userservice.php @@ -335,7 +335,7 @@ class UserService { } function isValidEmail($email) { - if (eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$", $email)) { + if (eregi("^((?:(?:(?:\w[\.\-\+_]?)*)\w)+)\@((?:(?:(?:\w[\.\-_]?){0,62})\w)+)\.(\w{2,6})$", $email)) { list($emailUser, $emailDomain) = split("@", $email); // Check if the email domain has a DNS record