Commit: 5d4b022d765691fc2ed93b663ec57fabce57ee33 Author: Sobak <[email protected]> Sun, 18 May 2014 18:37:07 +0200 Parents: bf3170a7e3c357421467bdf80807704214686b07 Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=5d4b022d765691fc2ed93b663ec57fabce57ee33 Log: Validate email address with filter_var instead of regexp Changed paths: M include/functions.php Diff: diff --git a/include/functions.php b/include/functions.php index 6cb081d..5f0dfe1 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1280,7 +1280,7 @@ function is_valid_email($email, $phpnet_allowed = true) return false; } } - return (bool) preg_match("/^[.\\w+-]+@[.\\w-]+\\.\\w{2,}\z/i", $email); + return (bool)filter_var($email, FILTER_VALIDATE_EMAIL); } /** -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
