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 use a big regex that doesn't extract the domain part. Anyway, having a good RFC compliant email validator cannot be done with a regex. See https://github.com/egulias/EmailValidator for instance. I think it's a work for another PR. I'll keep the email validator in it's current state for now. Do you guys are OK to get the current PR merged? 2014-11-12 19:10 GMT+01:00 Kévin Dunglas <dung...@gmail.com>: > 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: >>> - 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? >>> >> >> I haven't read diff closely, but it seems ok to me. >> How email domain is checked? I cannot see changes for it from the diff. >> >> Validating host correctly is difficult, I would like to have your PR. >> >> Regards, >> >> -- >> Yasuo Ohgaki >> yohg...@ohgaki.net >> > > > > -- > Kévin Dunglas > > http://dunglas.fr > -- Kévin Dunglas Consultant et développeur freelance http://dunglas.fr Tél. : 06 60 91 20 20