Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate INTL_IDNA_VARIANT_2003 #2355

Merged
merged 1 commit into from Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/intl/idn/idn.c
Expand Up @@ -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,
Expand Down
5 changes: 4 additions & 1 deletion ext/intl/tests/idn.phpt
Expand Up @@ -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
2 changes: 2 additions & 0 deletions ext/intl/tests/idn_uts46_errors.phpt
Expand Up @@ -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:
Expand Down