mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Fixes #483 - email validation. check_email() now using PHP5 filter_var()
This commit is contained in:
11
class2.php
11
class2.php
@@ -1270,8 +1270,15 @@ function js_location($qry)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_email($email)
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user