#50431 [Opn->Bgs]: Using filter_var to filter an email address returns incorrect result
| From: | rasmus@php.net | Date: | Wed, 09 Dec 2009 19:02:01 +0000 |
| Subject: | #50431 [Opn->Bgs]: Using filter_var to filter an email address returns incorrect result | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-145589@lists.php.net to get a copy of this message | ||
ID: 50431
Updated by: rasmus@php.net
Reported By: troy at scriptedmotion dot com
-Status: Open
+Status: Bogus
Bug Type: Filter related
Operating System: Ubuntu
PHP Version: 5.2.11
New Comment:
That's a valid email address. Email addresses don't need a tld. Try
emailing root@localhost, for example. Any locally defined host can
potentially receive email.
Previous Comments:
------------------------------------------------------------------------
[2009-12-09 18:59:19] troy at scriptedmotion dot com
Description:
------------
Using filter_var to filter a string containing an email address with no
top level domain returns the string instead of false.
For example:
filter_var('t@1', FILTER_VALIDATE_EMAIL);
returns 't@1' instead of false.
Reproduce code:
---------------
filter_var('t@1', FILTER_VALIDATE_EMAIL); // returns 't@1' instead of
false.
Expected result:
----------------
false
Actual result:
--------------
"t@1" // a string
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50431&edit=1