Posted by 63reasons on November 20, 2012 at 9:55pm
4 followers
| Project: | Link |
| Version: | 7.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | 63reasons |
| Status: | needs work |
Issue Summary
The TLD list in the valid domain extensions regex is not up to date; a number of Top-Level-Domains (TLDs) have since been created which are not represented here. Similarly, the contry code validator is too lax, which prevents the use of the unassigned TLDs while testing on local servers. Luckily the IANA maintains a list of valid TLDs that we can poll. This patch polls that list once a day and defaults to the current list if for whichever reason (intranet, etc.) it cannot reach the data source.
This way we won't have to update the module just because the TLD list is changing (and with the recent changes towards openness, the changes will be numerous)
| Attachment | Size |
|---|---|
| link.module.patch | 3.44 KB |
Comments
#1
New patch for this issue
#2
Look good for me.
#3
I like the idea of this, and wouldn't mind it with a couple of changes:
1) I've already added code that allows users to update the list of TLDs with a variable get, and created a function called _link_domains() that does a similar job to _link_get_TLD_regex. Personally, I prefer the function name _link_domains(), especially since:
2) I don't like the idea that a call to validate a value will trigger an attempt to load data from offsite - I'd rather we restricted that entirely to hook_cron, and just checked the current value when validating.
If you can fix those two up, I think we might have a winner!