#49576 [Opn->Fbk]: Filter var for validating email is not validating emails correctly

From: Date: Thu, 17 Sep 2009 10:08:40 +0000
Subject: #49576 [Opn->Fbk]: Filter var for validating email is not validating emails correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142456@lists.php.net to get a copy of this message
ID: 49576 Updated by: jani@php.net Reported By: mparkin at de-facto dot com -Status: Open +Status: Feedback Bug Type: Filter related Operating System: OSX Leopard PHP Version: 5.2.10 New Comment: Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2009-09-17 08:53:51] mparkin at de-facto dot com Description: ------------ Filter_Var does not validate emails accurately enough, and false positives are made. The regex needs improving - the regex we are using in kohanaphp framework (with preg_match) is more accurate. some more reading could be done here: http://fightingforalostcause.net/misc/2006/compare-email-regex.php Reproduce code: --------------- http://codepad.org/UIrhI5ep Expected result: ---------------- All emails in $valid are valid, all emails in $invalid are invalid. A far more accurate regex can be found here: http://dev.kohanaphp.com/projects/kohana2/repository/entry/trunk/system/helpers/valid.php#L20 Actual result: -------------- There are false positives and non failures. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49576&edit=1

« previous php.bugs (#142456) next »