symfony / polyfill

PHP polyfills

Home Page:https://symfony.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

polyfill-intl-idn v1.18 different behavior from v1.17

opened this issue · comments

After v1.18 update idn_to_ascii stopped producing the expected result. Here is a short script to reproduce (within php:7.3-cli-alpine container).

/app # composer require --quiet "symfony/polyfill-intl-idn:v1.17"
/app # php -r "require __DIR__ . '/vendor/autoload.php'; var_dump(Symfony\Polyfill\Intl\Idn\Idn::idn_to_ascii('test@bücher.de', IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46));"
string(21) "xn--test@bcher-feb.de"
/app # composer require --quiet "symfony/polyfill-intl-idn:v1.18"
/app # php -r "require __DIR__ . '/vendor/autoload.php'; var_dump(Symfony\Polyfill\Intl\Idn\Idn::idn_to_ascii('test@bücher.de', IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46));"
string(15) "test@bücher.de"

Expected result xn--test@bcher-feb.de, got back original unencoded string test@bücher.de

@TRowbotham can you have a look at this as you wrote the new implementation of that polyfill ?

I confirm that using idn_to_ascii('test@bücher.de', IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46) with ext-intl (on PHP 7.3) produces xn--test@bcher-feb.de so the new behavior of the polyfill is buggy.

Thank you for the report. I'll take a look at this tonight.