Skip to content
Snippets Groups Projects
Commit e94baab2 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Require '@' for valid email address

parent cd98e818
No related branches found
No related tags found
No related merge requests found
...@@ -141,6 +141,9 @@ class Validator { ...@@ -141,6 +141,9 @@ class Validator {
/*** Functions below can be called directly without class instance. /*** Functions below can be called directly without class instance.
Validator::func(var..); (nolint) ***/ Validator::func(var..); (nolint) ***/
function is_email($email) { function is_email($email) {
if (strpos($email, '@') === false)
return false;
require_once PEAR_DIR.'Mail/RFC822.php'; require_once PEAR_DIR.'Mail/RFC822.php';
return !PEAR::isError(Mail_RFC822::parseAddressList($email)); return !PEAR::isError(Mail_RFC822::parseAddressList($email));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment