From 01912f93c3f702b5b34a0a9a4c8f529785b0286a Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 15 Sep 2018 14:37:55 +0200 Subject: [PATCH] Change default of $variant param of idn_to_ascii() and idn_to_utf8() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit According to the “Deprecate and remove INTL_IDNA_VARIANT_2003” RFC[1], we change the default of the $variant parameter of `idn_to_ascii()` and `idn_to_utf8()` from `INTL_IDNA_VARIANT_2003` to `INTL_IDNA_VARIANT_UTS46`. [1] --- NEWS | 2 ++ UPGRADING | 4 ++++ ext/intl/idn/idn.c | 2 +- ext/intl/tests/idn.phpt | 5 +---- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 9583b1cb68..421eb707a9 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ PHP NEWS - Intl: . Lifted requirements to ICU ≥ 50.1. (cmb) + . Changed default of $variant parameter of idn_to_ascii() and idn_to_utf8(). + (cmb) - Standard: . Fixed bug #74764 (Bindto IPv6 works with file_get_contents but fails with diff --git a/UPGRADING b/UPGRADING index 344ff39ea1..729b5ebb2c 100644 --- a/UPGRADING +++ b/UPGRADING @@ -19,6 +19,10 @@ PHP 7.4 UPGRADE NOTES 1. Backward Incompatible Changes ======================================== +- Intl: + . The default parameter value of idn_to_ascii() and idn_to_utf8() is now + INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003. + ======================================== 2. New Features ======================================== diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index c9fc033024..bf855c3ef9 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -268,7 +268,7 @@ static void php_intl_idn_handoff(INTERNAL_FUNCTION_PARAMETERS, int mode) { zend_string *domain; zend_long option = 0, - variant = INTL_IDN_VARIANT_2003; + variant = INTL_IDN_VARIANT_UTS46; zval *idna_info = NULL; intl_error_reset(NULL); diff --git a/ext/intl/tests/idn.phpt b/ext/intl/tests/idn.phpt index 6c00c95493..8e004ec2e2 100644 --- a/ext/intl/tests/idn.phpt +++ b/ext/intl/tests/idn.phpt @@ -14,8 +14,5 @@ echo urlencode(idn_to_utf8('xn--tst-qla.de'))."\n"; ?> --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 +t%C3%A4st.de -- 2.40.0