php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48798 FILTER_VALIDATE_EMAIL pass the illness email
Submitted: 2009-07-04 14:11 UTC Modified: 2009-07-04 16:06 UTC
From: yanleech at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.2.10 OS: Ubuntu 9.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yanleech at gmail dot com
New email:
PHP Version: OS:

 

 [2009-07-04 14:11 UTC] yanleech at gmail dot com
Description:
------------
I do some filtering like:

filter_var($var, FILTER_VALIDATE_EMAIL);

and the email `blah@blah.com.` can be passed; and that must be a invalid email address cause no domain end with `.`(dot).

Reproduce code:
---------------
$var = 'blah@blah.com.';
echo (filter_var($var, FILTER_VALIDATE_EMAIL) === false) ? 'error':'passed';

Expected result:
----------------
error

Actual result:
--------------
passed

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-04 16:06 UTC] rasmus@php.net
Trailing dots are perfectly valid in domain names.

Try these, for example:

http://www.php.net./
http://www.google.com./
http://www.yahoo.com./

Now, some mail servers may reject an email sent to an address with a trailing dot, but others have no problems with them.  We have no way of knowing which mail servers accept them.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 00:01:30 2024 UTC