Re: Better RFC conformance for FILTER_VALIDATE_URL
| From: | Kévin Dunglas | Date: | Thu, 06 Nov 2014 06:19:50 +0000 |
| Subject: | Re: Better RFC conformance for FILTER_VALIDATE_URL | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78782@lists.php.net to get a copy of this message | ||
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
2014-11-06 0:32 GMT+01:00 Andrey Andreev <narf@devilix.net>:
> Hi,
>
> On Wed, Nov 5, 2014 at 11:57 PM, Kévin Dunglas <dunglas@gmail.com> wrote:
> >
> > - Added a new FILTER_VALIDATE_DOMAIN filter validating domain names
> > - Added a FILTER_FLAG_HOSTNAME flag to allow checking hostnames (_ are
> > forbidden in hostname but not in domains)
>
> This doesn't make any sense. A domain *is* a hostname and underscores
> are forbidden.
>
> Cheers,
> Andrey.
>
--
Kévin Dunglas
Consultant et développeur freelance
http://dunglas.fr
Tél. : 06 60 91 20 20