]> projects.mako.cc - scuttle/commitdiff
* Updated isValidEmail regex to match plussed addresses
authorMarcus Campbell <marcus.campbell@gmail.com>
Mon, 8 Jan 2007 07:26:37 +0000 (07:26 +0000)
committerMarcus Campbell <marcus.campbell@gmail.com>
Mon, 8 Jan 2007 07:26:37 +0000 (07:26 +0000)
services/userservice.php

index 1e7ed46981a39e46b0a4370d2b8735246ffd65d5..82abaf085fc1fdce8b59f12768793812c3fbb28f 100644 (file)
@@ -335,7 +335,7 @@ class UserService {
     }
 
     function isValidEmail($email) {
     }
 
     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
             list($emailUser, $emailDomain) = split("@", $email);
 
             // Check if the email domain has a DNS record

Benjamin Mako Hill || Want to submit a patch?