|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53722 FILTER_VALIDATE_EMAIL fails on numeric TLDs
Submitted: 2011-01-12 13:48 UTC Modified: 2011-02-18 16:24 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: romain dot riviere at gmail dot com Assigned:
Status: Not a bug Package: Filter related
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
48 + 9 = ?
Subscribe to this entry?

 [2011-01-12 13:48 UTC] romain dot riviere at gmail dot com
Although FILTER_VALIDATE_EMAIL accepts non-existent TLDs, it refuses to validate 
numeric TLDs.

AFAIK, there is no technical justification for this: numeric TLDs just work out of 
the box as far as the DNS know about them.

I suggest that the filter should validate numeric TLDs, or that a 
FILTER_FLAG_ALLOW_NUMTLD be created to alter the default behaviour of the filter.

Test script:
filter_var("johndoe@domain.123", FILTER_SANITIZE_EMAIL) ; // returns false


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-12 23:23 UTC]
-Package: *General Issues +Package: Filter related
 [2011-01-18 14:03 UTC]
-Status: Open +Status: Bogus
 [2011-01-18 14:03 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

There are no numeric TLDs, the e-mail filters supports IP based e-mail addresses 
 [2011-01-18 14:15 UTC] romain dot riviere at gmail dot com
There ARE numeric TLDs, even though they are not made public. I have one on my 
The filter should probably not rely on what is believed to exist, but on what is 
technically feasible.
In other words, if I can get email on the address johndoe@domain.123 (and again, 
YES, it works), then FILTER_VALIDATE_EMAIL should not reject such an address.
 [2011-02-13 23:30 UTC] frank9321 at gmail dot com
I think that Romain in right. There are numeric TLDs (like the .42 TLD wich is taking off), and sometimes, as Romain said, you use such TLDs in your LAN.
So, really, the FILTER_VALIDATE_EMAIL should accept numeric TLDs. It isn't because the ICANN said that there couldn't be numeric TLDs that there aren't.
 [2011-02-18 16:24 UTC] romain dot riviere at gmail dot com
Precisely. FILTER_VALIDATE_EMAIL should validate *technically* correct email 
addresses, not just ICANN-correct ones.
It is already the case for .foo or .bar TLDs, it just needs to do the same for 
numeric TLDs, because from a technical point of view, there are no different: old 
restrictions in old RFCs have all been superseded now.
 [2011-03-21 03:02 UTC] barkerjr at barkerjr dot net
This bug should be reopened.  We don't want PHP to be broken in the event that a 
numeric TLD is created.
 [2011-06-13 21:53 UTC] deadalnix at gmail dot com

I want to enlight the PHP team about . This TLD is more and more recognized and used, and we will reach a point where not supporting numerical TLD will be a major problem.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 14 15:01:30 2024 UTC