diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-03-28 10:55:27 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-03-28 10:55:27 +0000 |
commit | d1be768b28b17315c7785cbd1c7769bdf64665c7 (patch) | |
tree | 6eb77f2e24c205df37fa834ba3a1145f6df08c05 /modules/user/user.module | |
parent | 8e9d557ac83179d0c97a1b518965946856f1eac2 (diff) | |
download | brdo-d1be768b28b17315c7785cbd1c7769bdf64665c7.tar.gz brdo-d1be768b28b17315c7785cbd1c7769bdf64665c7.tar.bz2 |
- Moved the logic of email validation from user_validate_mail to a new function
in common.inc. Modified patch from Gerhard.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 8dd81ae35..c656e683d 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -182,17 +182,7 @@ function user_validate_name($name) { function user_validate_mail($mail) { - /* - ** Verify the syntax of the given e-mail address. Empty e-mail addresses - ** allowed. See RFC 2822 for details. - */ - - $user = '[a-zA-Z0-9_\-\.\+\^!#\$%&*+\/\=\?\`\|\{\}~\']+'; - $domain = '(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]\.?)+'; - $ipv4 = '[0-9]{1,3}(\.[0-9]{1,3}){3}'; - $ipv6 = '[0-9a-fA-F]{1,4}(\:[0-9a-fA-F]{1,4}){7}'; - - if ($mail && !preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail)) { + if ($mail && !validate_email_address($mail)) { return t("The e-mail address '%mail' is not valid.", array("%mail" => $mail)); } } |