[git] web/master.git branch master updated. 91c1ce5
| From: | rasmus@php.net | Date: | Tue, 07 Feb 2012 05:32:46 +0000 |
| Subject: | [git] web/master.git branch master updated. 91c1ce5 | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-13033@lists.php.net to get a copy of this message | ||
The branch, master on web/master.git has been updated
via 91c1ce5c3c2a32733e707511059c75c66b077e80 (commit)
from 4deec0f3ab5e126937eec4c5bed5f7375ecf5bbf (commit)
http://git.php.net/?p=web/master.git;a=log;h=91c1ce5c3c2a32733e707511059c75c66b077e80;hp=4deec0f3ab5e126937eec4c5bed5f7375ecf5bbf
Summary of changes:
include/email-validation.inc | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
-- Log ----------------------------------------
commit 91c1ce5c3c2a32733e707511059c75c66b077e80
Author: Rasmus Lerdorf <rasmus@php.net>
Date: Mon Feb 6 21:26:00 2012 -0800
Use a modern email validator
diff --git a/include/email-validation.inc b/include/email-validation.inc
index 70359b2..267b72d 100644
--- a/include/email-validation.inc
+++ b/include/email-validation.inc
@@ -12,18 +12,11 @@ function clean_antispam($email)
function is_emailable_address($email)
{
// Exclude our mailing list hosting servers
- $hosts_regex = "!(lists\.php\.net|chek[^\.*]\.com)!i";
+ $hosts_regex = "!(lists\.php\.net)!i";
$excluded_hosts = preg_match($hosts_regex, $email);
- // Email addresses need to match this pattern
- $email_regex = ":^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~ ])+" .
- "@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~ ]+\\.)+" .
- "[a-zA-Z]{2,6}\$:i";
-
- // If address is not under excluded hosts, and fits the regex,
- // then we belive that it is a good email address
if (!$excluded_hosts && !empty($email)) {
- return preg_match($email_regex, $email);
+ return filter_var($email, FILTER_VALIDATE_EMAIL) == $email;
} else {
return FALSE;
}
Thank you for your contribution.