#50204 [NEW]: FILTER_VALID_EMAIL passes without top level domain
| From: | brian dot sulzen at aescreations dot com | Date: | Tue, 17 Nov 2009 16:01:22 +0000 |
| Subject: | #50204 [NEW]: FILTER_VALID_EMAIL passes without top level domain | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-144710@lists.php.net to get a copy of this message | ||
From: brian dot sulzen at aescreations dot com
Operating system: FreeBSD 6.3
PHP version: 5.2.11
PHP Bug Type: Filter related
Bug description: FILTER_VALID_EMAIL passes without top level domain
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 bug report at http://bugs.php.net/?id=50204&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50204&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50204&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50204&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50204&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50204&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50204&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50204&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50204&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50204&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50204&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50204&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50204&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50204&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50204&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50204&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50204&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50204&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50204&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50204&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50204&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50204&r=mysqlcfg