Fix PHP warning "idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated" with PHP 7.2 (#6075)

pull/5917/merge
Aleksander Machniak 7 years ago
parent 489ad88617
commit ca39a4e093

@ -60,6 +60,7 @@ CHANGELOG Roundcube Webmail
- Fix broken long filenames when using imap4d server - workaround server bug (#6048) - Fix broken long filenames when using imap4d server - workaround server bug (#6048)
- Fix so temp_dir misconfiguration prints an error to the log (#6045) - Fix so temp_dir misconfiguration prints an error to the log (#6045)
- Fix untagged COPYUID responses handling - again (#5982) - Fix untagged COPYUID responses handling - again (#5982)
- Fix PHP warning "idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated" with PHP 7.2 (#6075)
RELEASE 1.3.3 RELEASE 1.3.3
------------- -------------

@ -892,7 +892,17 @@ class rcube_utils
$domain = $input; $domain = $input;
} }
$domain = $is_utf ? idn_to_ascii($domain) : idn_to_utf8($domain); // Note that in PHP 7.2/7.3 calling idn_to_* functions with default arguments
// throws a warning, so we have to set the variant explicitely (#6075)
$variant = INTL_IDNA_VARIANT_UTS46;
$options = 0;
if ($is_utf) {
$domain = idn_to_ascii($domain, $options, $variant);
}
else {
$domain = idn_to_utf8($domain, $options, $variant);
}
if ($domain === false) { if ($domain === false) {
return ''; return '';

Loading…
Cancel
Save