Opened 15 years ago
Closed 11 years ago
#15409 closed enhancement (wontfix)
Top-Level Domain (TLD) validation function and email validation/sanitization
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.1 |
Component: | Formatting | Keywords: | has-patch |
Focuses: | Cc: |
Description
The following patch proposes a new global function, does_value_end_in_valid_tld, to allow for a string value to be tested for as ending in a valid TLD.
TLD list as per http://data.iana.org/TLD/tlds-alpha-by-domain.txt
Regex inspired by http://gitorious.org/statusnet/mainline/blobs/master/lib/util.php#line724
The patch also implements using does_value_end_in_valid_tld() in is_email() and sanitize_email(), to start with.
Attachments (1)
Change History (14)
#3
@
15 years ago
Also, ICANN recently announced that TLDs will be a lot easier to register so I'm not sure if this function is a good idea anymore.
#4
@
15 years ago
ends_with_valid_tld(): sure, why not
TLD: Ideally, I'd say we should have the function, and once the TLDs are easier to register, find a way to make it dynamic by accessing some kind of API (or at least let people do via plugin with a hook). regardless, the existing list won;t become obsolete when they do.
#7
follow-up:
↓ 8
@
15 years ago
Found the place where I read that:
http://arstechnica.com/web/news/2010/11/icann-to-open-top-level-domain-floodgates.ars
#8
in reply to:
↑ 7
@
15 years ago
Replying to scribu:
Found the place where I read that:
http://arstechnica.com/web/news/2010/11/icann-to-open-top-level-domain-floodgates.ars
Oh cool, thanks for the ref! Okay, it does seem to be happening faster than I thought, but I guess we still have until 2012:
ICANN plans to release its guidebook for more public comments on Nov. 9, and to approve it at its next board meeting in Colombia in the first half of December. If all goes smoothly, they will begin accepting applications in May 2011 for new TLDs that would start functioning sometime in 2012. ICANN has said they will draw the line at 1,000 new TLDs per year.
FTR: this TLD check implementation was implemented on WordPress.com for signup and such, as a response to users mistyping their email addresses and being left in the dark. TLD validation was the sanest route for us.
#10
@
15 years ago
- Milestone changed from Awaiting Review to Future Release
Not sure about this, due to the pending changes. Would rather just make sure a hook is in place.
#12
follow-up:
↓ 13
@
15 years ago
So can this be entirely latched on to the various is_email hooks in is_email()?
#13
in reply to:
↑ 12
@
11 years ago
- Milestone Future Release deleted
- Resolution set to wontfix
- Status changed from accepted to closed
Replying to nacin:
So can this be entirely latched on to the various is_email hooks in is_email()?
Seems like yes. The generic 'is_email' filter would work. And yeah, now that we have arbitrary TLDs coming, this is not gonna happen.
How about naming it ends_with_valid_tld() instead? It's shorter.