Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Don't check for filter_var, we're using php 5.3+
Browse files Browse the repository at this point in the history
Signed-off-by: Etienne CHAMPETIER <etienne.champetier@fiducial.net>
  • Loading branch information
Etienne CHAMPETIER committed Nov 5, 2013
1 parent e57cff2 commit 5656dff
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions core/src/plugins/core.mailer/class.AjxpMailer.php
Expand Up @@ -189,24 +189,7 @@ public function abstractUserToAdress(AbstractAjxpUser $user)

public function validateEmail($email)
{
if (function_exists("filter_var")) {
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
}

$atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';
$domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)';

$regex = '/^' . $atom . '+' .
'(\.' . $atom . '+)*' .
'@' .
'(' . $domain . '{1,63}\.)+' .
$domain . '{2,63}$/i';

if (preg_match($regex, $email)) {
return true;
} else {
return false;
}
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
}

}

0 comments on commit 5656dff

Please sign in to comment.