Switch to IDNA2008 variant (#6806)

After switching IDNA_NONTRANSITIONAL_TO_ASCII on, switch to
IDNA2008 variant in Net_LDAP2. Add test, update changelog.
pull/6811/head
Aleksander Machniak 6 years ago
parent f1d3f9ee44
commit 0a0ad2c9b7

@ -8,6 +8,7 @@ CHANGELOG Roundcube Webmail
- Don't log full session identifiers in userlogins log (#6625) - Don't log full session identifiers in userlogins log (#6625)
- Support $HasAttachment/$HasNoAttachment keywords (#6201) - Support $HasAttachment/$HasNoAttachment keywords (#6201)
- Support PECL memcached extension as a session and cache storage driver (experimental) - Support PECL memcached extension as a session and cache storage driver (experimental)
- Switch to IDNA2008 variant (#6806)
- installto.sh: Add possibility to run the update even on the up-to-date installation (#6533) - installto.sh: Add possibility to run the update even on the up-to-date installation (#6533)
- Plugin API: Add 'render_folder_selector' hook - Plugin API: Add 'render_folder_selector' hook
- Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326) - Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326)

@ -379,7 +379,7 @@ if (!function_exists('idn_to_utf8'))
static $idn, $loaded; static $idn, $loaded;
if (!$loaded) { if (!$loaded) {
$idn = new Net_IDNA2(); $idn = new Net_IDNA2(array('version' => '2008'));
$loaded = true; $loaded = true;
} }
@ -402,7 +402,7 @@ if (!function_exists('idn_to_ascii'))
static $idn, $loaded; static $idn, $loaded;
if (!$loaded) { if (!$loaded) {
$idn = new Net_IDNA2(); $idn = new Net_IDNA2(array('version' => '2008'));
$loaded = true; $loaded = true;
} }

@ -958,12 +958,12 @@ class rcube_utils
if ($is_utf) { if ($is_utf) {
if (preg_match('/[^\x20-\x7E]/', $domain)) { if (preg_match('/[^\x20-\x7E]/', $domain)) {
$options = defined('IDNA_NONTRANSITIONAL_TO_ASCII') ? IDNA_NONTRANSITIONAL_TO_ASCII : 0; $options = defined('IDNA_NONTRANSITIONAL_TO_ASCII') ? IDNA_NONTRANSITIONAL_TO_ASCII : 0;
$domain = idn_to_ascii($domain, $options, $variant); $domain = idn_to_ascii($domain, $options, $variant);
} }
} }
else if (preg_match('/(^|\.)xn--/i', $domain)) { else if (preg_match('/(^|\.)xn--/i', $domain)) {
$options = defined('IDNA_NONTRANSITIONAL_TO_UNICODE') ? IDNA_NONTRANSITIONAL_TO_UNICODE : 0; $options = defined('IDNA_NONTRANSITIONAL_TO_UNICODE') ? IDNA_NONTRANSITIONAL_TO_UNICODE : 0;
$domain = idn_to_utf8($domain, $options, $variant); $domain = idn_to_utf8($domain, $options, $variant);
} }
if ($domain === false) { if ($domain === false) {

@ -598,8 +598,8 @@ class Framework_Utils extends PHPUnit_Framework_TestCase
array('рф.ru', 'xn--p1ai.ru'), array('рф.ru', 'xn--p1ai.ru'),
array('δοκιμή.gr', 'xn--jxalpdlp.gr'), array('δοκιμή.gr', 'xn--jxalpdlp.gr'),
array('gwóźdź.pl', 'xn--gwd-hna98db.pl'), array('gwóźdź.pl', 'xn--gwd-hna98db.pl'),
array('fußball.de', 'xn--fuball-cta.de'),
); );
} }
/** /**

Loading…
Cancel
Save