Skip to content

Commit 6cfbb7f

Browse files
committed
Deprecate INTL_IDNA_VARIANT_2003
As of ICU 55.1 the IDNA2003 APIs are deprecated, so we're deprecating INTL_IDNA_VARIANT_2003 as well, according to https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003.
1 parent fba9eb8 commit 6cfbb7f

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ext/intl/idn/idn.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode)
291291
}
292292
/* don't check options; it wasn't checked before */
293293

294+
if (variant == INTL_IDN_VARIANT_2003) {
295+
php_error_docref(NULL, E_DEPRECATED, "INTL_IDNA_VARIANT_2003 is deprecated");
296+
}
297+
294298
if (idna_info != NULL) {
295299
if (variant == INTL_IDN_VARIANT_2003) {
296300
php_error_docref0(NULL, E_NOTICE,

ext/intl/tests/idn.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ echo idn_to_ascii("t\xC3\xA4st.de")."\n";
1313
echo urlencode(idn_to_utf8('xn--tst-qla.de'))."\n";
1414

1515
?>
16-
--EXPECT--
16+
--EXPECTF--
17+
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d
1718
xn--tst-qla.de
19+
20+
Deprecated: idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d
1821
t%C3%A4st.de

ext/intl/tests/idn_uts46_errors.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Warning: idn_to_ascii(): idn_to_ascii: empty domain name in %s on line %d
6262
bool(false)
6363
fourth arg for 2003 variant (only notice raised):
6464

65+
Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d
66+
6567
Notice: idn_to_ascii(): 4 arguments were provided, but INTL_IDNA_VARIANT_2003 only takes 3 - extra argument ignored in %s on line %d
6668
string(7) "foo.com"
6769
with error, but no details arg:

0 commit comments

Comments
 (0)