1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Revert "Move to non deprecated API on suitable ICU versions"
This commit is contained in:
Sara Golemon
2019-08-16 11:40:01 -04:00

View File

@@ -198,34 +198,16 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
}
RETURN_FALSE;
} else {
UParseError parse_error;
UChar converted[MAXPATHLEN];
int32_t converted_ret_len;
status = U_ZERO_ERROR;
#if U_ICU_VERSION_MAJOR_NUM >= 55
UIDNAInfo info = UIDNA_INFO_INITIALIZER;
UIDNA *idna = uidna_openUTS46((int32_t)option, &status);
if (U_FAILURE(status)) {
intl_error_set( NULL, status, "idn_to_ascii: failed to create an UIDNA instance", 0 );
RETURN_FALSE;
}
if (mode == INTL_IDN_TO_ASCII) {
converted_ret_len = uidna_nameToASCII(idna, ustring, ustring_len, converted, MAXPATHLEN, &info, &status);
} else {
converted_ret_len = uidna_nameToUnicode(idna, ustring, ustring_len, converted, MAXPATHLEN, &info, &status);
}
uidna_close(idna);
#else
UParseError parse_error;
if (mode == INTL_IDN_TO_ASCII) {
converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
} else {
converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
}
#endif
efree(ustring);
if (U_FAILURE(status)) {