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

From: Date: Thu, 17 Sep 2009 10:32:24 +0000
Subject: #49576 [Fbk->Opn]: Filter var for validating email is not validating emails correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-142457@lists.php.net to get a copy of this message
 ID:               49576
 User updated by:  mparkin at de-facto dot com
 Reported By:      mparkin at de-facto dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Filter related
 Operating System: OSX Leopard
 PHP Version:      5.2.10
 New Comment:

Sorry I do not have the ability to test the code on the snapshot at
this time.

Would it not be possible for you to run the code provided in the
codepad.org paste?


Previous Comments:
------------------------------------------------------------------------

[2009-09-17 10:08:40] jani@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/



------------------------------------------------------------------------

[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



Thread (15 messages)

« previous php.bugs (#142457) next »