php.net |  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
Votes:1
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
 [2011-01-12 13:48 UTC] romain dot riviere at gmail dot com
Description:
------------
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



Patches

Pull Requests

History

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

There are no numeric TLDs, the e-mail filters supports IP based e-mail addresses 
however.
 [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 
LAN.
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
Hi,

I want to enlight the PHP team about https://www.42registry.org/ . 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: Sat Dec 21 12:01:31 2024 UTC