On Fri, Sep 19, 2014 at 1:24 PM, Kévin Dunglas <dung...@gmail.com> wrote:
> Hi, > > The flag is a good idea to handle old systems but the feature must be > enabled by default (at least for PHP 7) and disablable through the flag. > IDN RFCs are more than 10 years old. All major browsers and registrars > support IDN. > My apologies, I meant the inverse. If ICU is enabled we should make FILTER_VALIDATE_URL check IDN by default and add a flag to allow malformed IDN. However, it should not enforce the dependency on ICU itself; if it's there, it will be used, otherwise it will allow malformed IDN by default (if present). Personally I wouldn't mind having this for 5.6 as well if the upgrade path is clean, but the cleanest path I could think of involves having two flags that do the opposite action :) > > Le vendredi 19 septembre 2014, Tjerk Meesters <tjerk.meest...@gmail.com> > a écrit : > > >> On 19 Sep 2014, at 06:52, Andrea Faulds <a...@ajf.me> wrote: >> >> > >> > On 18 Sep 2014, at 21:26, Kévin Dunglas <dung...@gmail.com> wrote: >> > >> >> I'm working on enhancing the FILTER_VALIDATE_URL filter ( >> >> https://github.com/php/php-src/pull/826). >> >> The current implementation does not support validation of >> internationalized >> >> domain names (i.e: http://www.académie-française.fr/ >> <http://www.xn--acadmie-franaise-npb1a.fr/> >> >> <http://www.xn--acadmie-franaise-npb1a.fr/>). >> >> >> >> Support of IDN validation can be easily added using ICU's >> uidna_toASCII() >> >> function. >> >> >> >> Is it acceptable to add a dependency to ICU for ext/filter? >> >> Another option is to add a HAVE_ICU constant in main/php_config.h and >> to >> >> validate IDN only if ICU is present. >> >> >> >> What strategy is preferred? >> > >> > Perhaps add a new filter that covers normal URLs and IDN ones? I just >> imagine it might cause problems if suddenly IDNs are accepted, if there is >> a backend which can’t handle them. >> >> We don’t need a new filter, you can simply add a filter flag for >> FILTER_VALIDATE_URL, e.g. FILTER_FLAG_ALLOW_IDN. >> >> Of course, the ICU dependency should be optional :) >> >> > >> > -- >> > Andrea Faulds >> > http://ajf.me/ >> > >> > >> > >> > >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> >> > > -- > Kévin Dunglas > Consultant et développeur freelance > > http://dunglas.fr > Tél. : 06 60 91 20 20 > > -- -- Tjerk