#50204 [Opn->Bgs]: FILTER_VALID_EMAIL passes without top level domain
| From: | rasmus@php.net | Date: | Tue, 17 Nov 2009 16:06:04 +0000 |
| Subject: | #50204 [Opn->Bgs]: FILTER_VALID_EMAIL passes without top level domain | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144711@lists.php.net to get a copy of this message | ||
ID: 50204
Updated by: rasmus@php.net
Reported By: brian dot sulzen at aescreations dot com
-Status: Open
+Status: Bogus
Bug Type: Filter related
Operating System: FreeBSD 6.3
PHP Version: 5.2.11
New Comment:
That's not a bug. It only validates that the address looks valid, not
whether the email address actually exists. email addresses without a
tld are perfectly valid. Try sending an email to: root@localhost for
example. Or on my personal server rasmus@colo works. Same for Intranet
applications. You can have all sorts of valid email addresses that have
no TLD.
Previous Comments:
------------------------------------------------------------------------
[2009-11-17 16:01:21] brian dot sulzen at aescreations dot com
Description:
------------
FILTER_VALIDATE_EMAIL is passes addresses with out top level domain
(i.e., .com, .net, etc).
Reproduce code:
---------------
<?php
$email_address = "test2_mail@example";
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
$email_address = "test-mail@example.com";
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
$email_address = "test+mail@example.com";
var_dump(filter_var($email_address, FILTER_VALIDATE_EMAIL));
?>
Expected result:
----------------
bool(false)
string(21) "test-mail@example.com"
string(21) "test+mail@example.com"
Actual result:
--------------
string(18) "test2_mail@example"
string(21) "test-mail@example.com"
string(21) "test+mail@example.com"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50204&edit=1