Skip to content

Commit 9b9814f

Browse files
committed
Revert "Move to non deprecated API on suitable ICU versions"
This reverts commit 13a2f2d. The APIs used by this commit aren't entirely equivalent to the original ones.
1 parent 4966647 commit 9b9814f

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.3.10
44

5+
- Intl:
6+
. Ensure IDNA2003 rules are used with idn_to_ascii() and idn_to_utf8()
7+
when requested. (Sara)
8+
59
29 Aug 2019, PHP 7.3.9
610

711
- Core:

ext/intl/idn/idn.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -224,34 +224,16 @@ static void php_intl_idn_to(INTERNAL_FUNCTION_PARAMETERS,
224224
}
225225
RETURN_FALSE;
226226
} else {
227+
UParseError parse_error;
227228
UChar converted[MAXPATHLEN];
228229
int32_t converted_ret_len;
229230

230231
status = U_ZERO_ERROR;
231-
232-
#if U_ICU_VERSION_MAJOR_NUM >= 55
233-
UIDNAInfo info = UIDNA_INFO_INITIALIZER;
234-
UIDNA *idna = uidna_openUTS46((int32_t)option, &status);
235-
236-
if (U_FAILURE(status)) {
237-
intl_error_set( NULL, status, "idn_to_ascii: failed to create an UIDNA instance", 0 );
238-
RETURN_FALSE;
239-
}
240-
241-
if (mode == INTL_IDN_TO_ASCII) {
242-
converted_ret_len = uidna_nameToASCII(idna, ustring, ustring_len, converted, MAXPATHLEN, &info, &status);
243-
} else {
244-
converted_ret_len = uidna_nameToUnicode(idna, ustring, ustring_len, converted, MAXPATHLEN, &info, &status);
245-
}
246-
uidna_close(idna);
247-
#else
248-
UParseError parse_error;
249232
if (mode == INTL_IDN_TO_ASCII) {
250233
converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
251234
} else {
252235
converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status);
253236
}
254-
#endif
255237
efree(ustring);
256238

257239
if (U_FAILURE(status)) {

0 commit comments

Comments
 (0)