Skip to content

Commit 2ed4723

Browse files
committed
Merge branch 'pull-request/2355'
* pull-request/2355: Deprecate INTL_IDNA_VARIANT_2003 We also add a respective note to UPGRADING.
2 parents 6bb1fd9 + 6cfbb7f commit 2ed4723

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ PHP 8.0.
128128
. The gmp_random() function has been deprecated, use gmp_random_bits() or
129129
gmp_random_range() instead.
130130

131+
- Intl:
132+
. INTL_IDNA_VARIANT_2003 has been deprecated; use INTL_IDNA_VARIANT_UTS46
133+
instead.
134+
131135
- Mbstring:
132136
. The mbstring.func_overload ini directive has been deprecated.
133137

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)