#47772 [Opn->Csd]: filter_var() returnes nothing for some invalid e-mails

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               47772
 Updated by:       [email protected]
 Reported By:      saschagros at gmail dot com
-Status:           Open
+Status:           Closed
 Bug Type:         Filter related
 Operating System: Ubuntu 9.04 Jaunty
 PHP Version:      5.3.0RC1
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Your 1st e-mail is valid, in fact many "local" domains on intranets 
would not have a domain extension. foo@bar is perfectly valid.

The allowance for foo@bar. is a bug and a fix for it has just been 
applied.


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

[2009-03-25 13:31:58] saschagros at gmail dot com

Description:
------------
filter_var incorrectly validates some invalid e-mail adresses (see
reproduce code).

Note: I am not 100% sure that this is the wrong behavior, however, it
has changed from php 5.2 and I can't find a related bug or NEWS entry.

Reproduce code:
---------------
var_dump(filter_var('invalid@site', FILTER_VALIDATE_EMAIL));
var_dump(filter_var('invalid@site.', FILTER_VALIDATE_EMAIL));

Expected result:
----------------
bool(false)
bool(false)

Actual result:
--------------
string(13) "invalid@site."
string(12) "invalid@site"


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


-- 
Edit this bug report at http://bugs.php.net/?id=47772&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.