Re: Internationalized Domain Name support in FILTER_VALIDATE_URL
| From: | Andrea Faulds | Date: | Thu, 18 Sep 2014 22:52:24 +0000 |
| Subject: | Re: Internationalized Domain Name support in FILTER_VALIDATE_URL | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-77323@lists.php.net to get a copy of this message | ||
On 18 Sep 2014, at 21:26, Kévin Dunglas <dunglas@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/>).
>
> 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.
--
Andrea Faulds
http://ajf.me/