Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-14 Thread Kévin Dunglas
I've just pushed some changes in the PR. FILTER_VALIDATE_DOMAIN now checks characters validity only if FILTER_FLAG_HOSTNAME is set. I've also rebased and fixed some issues detailed on GitHub. Yasuo, it's not trivial to use this new validator in FILTER_VALIDATE_EMAIL. Its current implementation

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-12 Thread Yasuo Ohgaki
Hi Kevin, On Wed, Nov 12, 2014 at 4:09 PM, Kévin Dunglas dung...@gmail.com wrote: I'll change my PR according to the RFC I've quoted earlier: - check for valid characters (excluding underscore) only when FILTER_FLAG_HOSTNAME is set - allow any character but check lengths by default - use

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-12 Thread Kévin Dunglas
Hi Yasuo, I've not changed (and even read) the email validator. I'll take a look at it. 2014-11-12 10:41 GMT+01:00 Yasuo Ohgaki yohg...@ohgaki.net: Hi Kevin, On Wed, Nov 12, 2014 at 4:09 PM, Kévin Dunglas dung...@gmail.com wrote: I'll change my PR according to the RFC I've quoted earlier:

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-11 Thread Yasuo Ohgaki
Hi all, On Fri, Nov 7, 2014 at 6:48 AM, Sanford Whiteman figureone...@gmail.com wrote: FWIW, there *is* a practical in-use (de facto if nothing else) convention of using _ in hosts for DKIM: _domainkey is actually in all the DKIM RFCs and in the formal STD 76, see § 3.6.2.1. Namespace, so

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-11 Thread Kévin Dunglas
Hi, I'll change my PR according to the RFC I've quoted earlier: - check for valid characters (excluding underscore) only when FILTER_FLAG_HOSTNAME is set - allow any character but check lengths by default - use FILTER_FLAG_HOSTNAME to validate URLs What do you think about that? Best regards,

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-06 Thread Andrey Andreev
Hi, On Thu, Nov 6, 2014 at 8:19 AM, Kévin Dunglas dung...@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

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-06 Thread Kévin Dunglas
FILTER_VALIDATE_DOMAIN checks conformance with DNS RFCs : total length, label length and allowed characters (_ are allowed in domain names but many other characters are forbidden such as ~/+...). I'll add IDN support too when IDN support for streams will be merged. FILTER_VALIDATE_URL checks

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-06 Thread Andrey Andreev
Hi, On Thu, Nov 6, 2014 at 3:39 PM, Kévin Dunglas dung...@gmail.com wrote: FILTER_VALIDATE_DOMAIN checks conformance with DNS RFCs : total length, label length and allowed characters (_ are allowed in domain names but many other characters are forbidden such as ~/+...). I'll add IDN support

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-06 Thread Sean Coates
On Thu, Nov 6, 2014 at 3:39 PM, Kévin Dunglas dung...@gmail.com wrote: FILTER_VALIDATE_DOMAIN checks conformance with DNS RFCs : total length, label length and allowed characters (_ are allowed in domain names but many other characters are forbidden such as ~/+...). I'll add IDN support too

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-06 Thread Sanford Whiteman
FWIW, there *is* a practical in-use (de facto if nothing else) convention of using _ in hosts for DKIM: _domainkey is actually in all the DKIM RFCs and in the formal STD 76, see § 3.6.2.1. Namespace, so it's more than a convention! -- PHP Internals - PHP Runtime Development Mailing List To

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-05 Thread Kévin Dunglas
Hi, According to the discussion on GitHub, I've made some changes on this PR: - 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) - Changed FILTER_VALIDATE_URL to use

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-05 Thread Andrey Andreev
Hi, On Wed, Nov 5, 2014 at 11:57 PM, Kévin Dunglas dung...@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

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-11-05 Thread Kévin Dunglas
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

[PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-10-14 Thread Kévin Dunglas
Hi, I opened a PR making FILTER_VALIDATE_URL more strict and more compliant with standards: https://github.com/php/php-src/pull/826 Can anyone review (and merge) this patch? Thanks! -- Kévin Dunglas Consultant et développeur freelance http://dunglas.fr Tél. : 06 60 91 20 20

Re: [PHP-DEV] Better RFC conformance for FILTER_VALIDATE_URL

2014-10-14 Thread Daniel Ribeiro
Nice work man, it looks really good. Daniel Ribeiro http://danielribeiro.org On Tue, Oct 14, 2014 at 3:41 PM, Kévin Dunglas dung...@gmail.com wrote: Hi, I opened a PR making FILTER_VALIDATE_URL more strict and more compliant with standards: https://github.com/php/php-src/pull/826 Can