summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-09-15 14:37:55 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-09-15 14:41:30 +0200
commit01912f93c3f702b5b34a0a9a4c8f529785b0286a (patch)
tree6106d69fc735e12f6e381101de37e7b9803e5d23
parent8a4c2f16217fb8f8d098355f3943f31e82bcfd71 (diff)
downloadphp-git-01912f93c3f702b5b34a0a9a4c8f529785b0286a.tar.gz
Change default of $variant param of idn_to_ascii() and idn_to_utf8()
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] <https://wiki.php.net/rfc/deprecate-and-remove-intl_idna_variant_2003>
-rw-r--r--NEWS2
-rw-r--r--UPGRADING4
-rw-r--r--ext/intl/idn/idn.c2
-rw-r--r--ext/intl/tests/idn.phpt5
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