Use PHP's filter_var function for email validation

This commit is contained in:
Dmitriy Simushev 2015-03-16 15:58:34 +00:00
parent 6e71f0542b
commit 833d2a9096

View File

@ -40,5 +40,5 @@ function verify_param($name, $reg_exp, $default = null)
function is_valid_email($email)
{
return preg_match("/^[^@]+@[^\.]+(\.[^\.]+)*$/", $email);
return (bool)filter_var($email, FILTER_VALIDATE_EMAIL);
}