1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-15 10:02:02 +02:00

Fixes #483 - email validation. check_email() now using PHP5 filter_var()

This commit is contained in:
Cameron 2014-05-22 18:16:44 -07:00
parent 6d649de543
commit 977369ad84

View File

@ -1270,8 +1270,15 @@ function js_location($qry)
}
function check_email($email)
{
return preg_match("/^([_a-zA-Z0-9-+]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,6})$/" , $email) ? $email : false;
{
if(filter_var($email, FILTER_VALIDATE_EMAIL))
{
return $email;
}
return false;
// return preg_match("/^([_a-zA-Z0-9-+]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,6})$/" , $email) ? $email : false;
}
//---------------------------------------------------------------------------------------------------------------------------------------------