diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-16 17:50:02 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-16 17:50:02 +0000 |
commit | ae31a4ab76fb8f89500fd509df8c951b4770e006 (patch) | |
tree | e7ed67162371cfb72141483228faa8a81102cf8e /includes | |
parent | 2f3146f04166cd817d680f60acb0d712b6e16470 (diff) | |
download | brdo-ae31a4ab76fb8f89500fd509df8c951b4770e006.tar.gz brdo-ae31a4ab76fb8f89500fd509df8c951b4770e006.tar.bz2 |
- Patch #308138 by mfer, Dave Reid: replace valid_email_address with filter_var and FILTER_VALIDATE_EMAIL.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/includes/common.inc b/includes/common.inc index 33109f00e..69227435e 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -866,12 +866,7 @@ function t($string, $args = array(), $langcode = NULL) { * TRUE if the address is in a valid format. */ function valid_email_address($mail) { - $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}'; - - return (bool)preg_match("/^$user@($domain|(\[($ipv4|$ipv6)\]))$/", $mail); + return (bool)filter_var($mail, FILTER_VALIDATE_EMAIL); } /** |