Commit cc20b293 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #1859 Changed email validation system

Showing with 9 additions and 9 deletions
+9 -9
......@@ -271,18 +271,18 @@ class tests {
*
* \param boolean $template FALSE
*/
public static function is_email($address, $template= FALSE)
public static function is_email($address, $deprecated = FALSE)
{
if ($address == ""){
return (TRUE);
if ($address == "") {
return TRUE;
}
if ($template){
return preg_match ("/^[._a-z0-9%\+-]+@[_a-z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
$address);
} else {
return preg_match ("/^[._a-z0-9\+-]+@[_a-z0-9-]+(\.[a-z0-9i-]+)(\.[a-z0-9-]+)*$/i",
$address);
if (filter_var($address, FILTER_VALIDATE_EMAIL) !== FALSE) {
return TRUE;
} elseif (filter_var($address.'.com', FILTER_VALIDATE_EMAIL) !== FALSE) {
/* this is to allow addresses like example@localhost, which are refused by some PHP version */
return TRUE;
}
return FALSE;
}
......
  • bmortier @bmortier

    mentioned in issue #661 (closed)

    By agallavardin on 2017-09-02T14:54:38 (imported from GitLab)

    ·

    mentioned in issue #661 (closed)

    By agallavardin on 2017-09-02T14:54:38 (imported from GitLab)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment