Re: Better RFC conformance for FILTER_VALIDATE_URL
| From: | Andrey Andreev | Date: | Thu, 06 Nov 2014 12:55:06 +0000 |
| Subject: | Re: Better RFC conformance for FILTER_VALIDATE_URL | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78814@lists.php.net to get a copy of this message | ||
Hi,
On Thu, Nov 6, 2014 at 8:19 AM, Kévin Dunglas <dunglas@gmail.com> wrote:
> Hi Andrey,
>
> Sorry but I think you're wrong. Domain != hostname. Underscore are allowed
> in domains (RFC 2181) but not in hostnames (RFC 1123 and next). To quote
> Wikipedia:
>
> "While a hostname may not contain other characters, such as the underscore
> character (_), other DNS names may contain the underscore. Systems such
> asDomainKeys and service records use the underscore as a means to assure
> that their special character is not confused with hostnames. For
> example,_http._sctp.www.example.com specifies a service pointer for an SCTP
> capable webserver host (www) in the domain example.com."
>
> http://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
>
> You can also see this StackOverflow answer
> http://stackoverflow.com/a/2183140/1352334
I agree to an extent, but that is highly contextual.
Who said that 'domain' === 'DNS record' (which is a very broad term
anyway)? And IF we assume this, why do you need FILTER_VALIDATE_DOMAIN
for it if it's only going to check length?
Cheers,
Andrey.