diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2017-02-14 14:03:24 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2017-02-14 14:16:54 +0100 |
commit | 2ed4723aff52b01b57473e2ae5cc22649648954c (patch) | |
tree | 8068939fd64ac1478b805dff116ad92298a3f6a4 | |
parent | 6bb1fd9032a09130872761a0c10ae6c2d874da05 (diff) | |
parent | 6cfbb7f9bd4576f8f6172a33d49e7498b3b617e1 (diff) | |
download | php-git-2ed4723aff52b01b57473e2ae5cc22649648954c.tar.gz |
Merge branch 'pull-request/2355'
* pull-request/2355:
Deprecate INTL_IDNA_VARIANT_2003
We also add a respective note to UPGRADING.
-rw-r--r-- | UPGRADING | 4 | ||||
-rw-r--r-- | ext/intl/idn/idn.c | 4 | ||||
-rw-r--r-- | ext/intl/tests/idn.phpt | 5 | ||||
-rw-r--r-- | ext/intl/tests/idn_uts46_errors.phpt | 2 |
4 files changed, 14 insertions, 1 deletions
@@ -128,6 +128,10 @@ PHP 8.0. . The gmp_random() function has been deprecated, use gmp_random_bits() or gmp_random_range() instead. +- Intl: + . INTL_IDNA_VARIANT_2003 has been deprecated; use INTL_IDNA_VARIANT_UTS46 + instead. + - Mbstring: . The mbstring.func_overload ini directive has been deprecated. diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 4a4a09f26f..adfa81f026 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -291,6 +291,10 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode) } /* don't check options; it wasn't checked before */ + if (variant == INTL_IDN_VARIANT_2003) { + php_error_docref(NULL, E_DEPRECATED, "INTL_IDNA_VARIANT_2003 is deprecated"); + } + if (idna_info != NULL) { if (variant == INTL_IDN_VARIANT_2003) { php_error_docref0(NULL, E_NOTICE, diff --git a/ext/intl/tests/idn.phpt b/ext/intl/tests/idn.phpt index fde822a560..6c00c95493 100644 --- a/ext/intl/tests/idn.phpt +++ b/ext/intl/tests/idn.phpt @@ -13,6 +13,9 @@ echo idn_to_ascii("t\xC3\xA4st.de")."\n"; echo urlencode(idn_to_utf8('xn--tst-qla.de'))."\n"; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d xn--tst-qla.de + +Deprecated: idn_to_utf8(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d t%C3%A4st.de
\ No newline at end of file diff --git a/ext/intl/tests/idn_uts46_errors.phpt b/ext/intl/tests/idn_uts46_errors.phpt index 3b1a2f0d5b..5de890ea67 100644 --- a/ext/intl/tests/idn_uts46_errors.phpt +++ b/ext/intl/tests/idn_uts46_errors.phpt @@ -62,6 +62,8 @@ Warning: idn_to_ascii(): idn_to_ascii: empty domain name in %s on line %d bool(false) fourth arg for 2003 variant (only notice raised): +Deprecated: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated in %s on line %d + Notice: idn_to_ascii(): 4 arguments were provided, but INTL_IDNA_VARIANT_2003 only takes 3 - extra argument ignored in %s on line %d string(7) "foo.com" with error, but no details arg: |