From: Yasuo Ohgaki Date: Wed, 12 Mar 2014 08:54:22 +0000 (+0900) Subject: Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding X-Git-Tag: php-5.6.0beta1~3^2~64^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca927bb47ea7702532922b648d7a6feba034fca0;p=php Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding --- diff --git a/UPGRADING b/UPGRADING index 4c05ee4391..c9b189da66 100755 --- a/UPGRADING +++ b/UPGRADING @@ -64,6 +64,7 @@ PHP 5.6 UPGRADE NOTES - Added unified default encoding. default_charset=UTF-8 and functions/extensions use encoding settings honor default_charset. + (https://wiki.php.net/rfc/default_encoding) - The php://input stream is now re-usable and can be used concurrently with enable_post_data_reading=0. @@ -281,10 +282,21 @@ PHP 5.6 UPGRADE NOTES enabled and to recognize the value -1 for never populating the global $HTTP_RAW_POST_DATA variable, which will be default in future PHP versions. +- Iconv: + Use of iconv.input_encoding, iconv.output_encoding, iconv.internal_encoding + raises E_DEPRECATE. Use empty value to use default_charset setting and/or + use input_encoding, output_encoding, internal_encoding. + - OpenSSL: openssl.cafile and openssl.capath ini directives have been added to allow global CA default specification as necessary. +- Mbstring: + Use of mbstring.http_input, mbstring.http_output, mbstring.internal_encoding + raises E_DEPRECATE. Use empty value to use default_charset setting and/or + use input_encoding, output_encoding, internal_encoding. + + ======================================== 11. Other Changes ======================================== diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 87ad5eeaab..57aed6b4b0 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -227,6 +227,9 @@ static PHP_INI_MH(OnUpdateInputEncoding) return FAILURE; } if (new_value_length) { + if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) { + php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.input_encoding is deprecated"); + } OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { OnUpdateString(entry, PG(input_encoding), strlen(PG(input_encoding))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); @@ -241,6 +244,9 @@ static PHP_INI_MH(OnUpdateOutputEncoding) return FAILURE; } if (new_value_length) { + if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) { + php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.output_encoding is deprecated"); + } OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { OnUpdateString(entry, PG(output_encoding), strlen(PG(output_encoding))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); @@ -255,6 +261,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding) return FAILURE; } if (new_value_length) { + if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) { + php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.internal_encoding is deprecated"); + } OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); } else { OnUpdateString(entry, PG(internal_encoding), strlen(PG(internal_encoding))+1, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); diff --git a/ext/iconv/tests/iconv_encoding_basic.phpt b/ext/iconv/tests/iconv_encoding_basic.phpt index 746858161c..35314f1e69 100644 --- a/ext/iconv/tests/iconv_encoding_basic.phpt +++ b/ext/iconv/tests/iconv_encoding_basic.phpt @@ -6,6 +6,7 @@ extension_loaded('iconv') or die('skip'); function_exists('iconv_get_encoding') or die("skip iconv_get_encoding() is not available in this build"); ?> --INI-- +error_reporting=E_ALL & ~E_DEPRECATED iconv.input_encoding=ISO-8859-1 iconv.internal_encoding=ISO-8859-1 iconv.output_encoding=ISO-8859-1 diff --git a/ext/iconv/tests/iconv_get_encoding_basic.phpt b/ext/iconv/tests/iconv_get_encoding_basic.phpt index 83efd1586d..84ee932e10 100644 --- a/ext/iconv/tests/iconv_get_encoding_basic.phpt +++ b/ext/iconv/tests/iconv_get_encoding_basic.phpt @@ -5,6 +5,8 @@ Oystein Rose #PHPTestFest2009 Norway 2009-06-09 \o/ --SKIPIF-- +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- --INI-- +error_reporting=E_ALL & ~E_DEPRECATED default_charset=ISO-8859-1 internal_encoding= input_encoding= diff --git a/ext/iconv/tests/iconv_set_encoding_variation.phpt b/ext/iconv/tests/iconv_set_encoding_variation.phpt index e239c6c18b..4e097569fd 100644 --- a/ext/iconv/tests/iconv_set_encoding_variation.phpt +++ b/ext/iconv/tests/iconv_set_encoding_variation.phpt @@ -5,6 +5,8 @@ Test iconv_set_encoding() function : error functionality extension_loaded('iconv') or die('skip'); function_exists('iconv_set_encoding') or die("skip iconv_set_encoding() is not available in this build"); ?> +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- +--INI-- +error_reporting=E_ALL & ~E_DEPRECATED --FILE-- --INI-- +error_reporting=E_ALL & ~E_DEPRECATED default_charset=Shift_JIS internal_encoding= input_encoding= diff --git a/ext/mbstring/tests/zend_multibyte-02.phpt b/ext/mbstring/tests/zend_multibyte-02.phpt index ebc10b48be..8a1a572804 100644 --- a/ext/mbstring/tests/zend_multibyte-02.phpt +++ b/ext/mbstring/tests/zend_multibyte-02.phpt @@ -1,7 +1,5 @@ --TEST-- zend multibyte (2) ---XFAIL-- -https://bugs.php.net/bug.php?id=66582 --INI-- zend.multibyte=On zend.script_encoding=UTF-8 diff --git a/ext/mbstring/tests/zend_multibyte-06.phpt b/ext/mbstring/tests/zend_multibyte-06.phpt index e0b4ead545..1b8adb5186 100644 --- a/ext/mbstring/tests/zend_multibyte-06.phpt +++ b/ext/mbstring/tests/zend_multibyte-06.phpt @@ -1,7 +1,5 @@ --TEST-- zend multibyte (6) ---XFAIL-- -https://bugs.php.net/bug.php?id=66582 --INI-- zend.multibyte=On zend.script_encoding=EUC-JP diff --git a/ext/mbstring/tests/zend_multibyte-07.phpt b/ext/mbstring/tests/zend_multibyte-07.phpt index 08db1d0f70..50d4cd95ed 100644 --- a/ext/mbstring/tests/zend_multibyte-07.phpt +++ b/ext/mbstring/tests/zend_multibyte-07.phpt @@ -4,6 +4,7 @@ zend multibyte (7) --XFAIL-- https://bugs.php.net/bug.php?id=66582 --INI-- +error_reporting=E_ALL & ~E_DEPRECATED zend.multibyte=On zend.script_encoding=ISO-8859-1 mbstring.internal_encoding=EUC-JP diff --git a/ext/mbstring/tests/zend_multibyte-08.phpt b/ext/mbstring/tests/zend_multibyte-08.phpt index 488e2a00ca..a0989fc562 100644 --- a/ext/mbstring/tests/zend_multibyte-08.phpt +++ b/ext/mbstring/tests/zend_multibyte-08.phpt @@ -1,6 +1,8 @@ --TEST-- zend multibyte (8) --SKIPIF-- +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- zend.multibyte=On zend.script_encoding=ISO-8859-1 diff --git a/ext/mbstring/tests/zend_multibyte-09.phpt b/ext/mbstring/tests/zend_multibyte-09.phpt index 8ad00b4e1e..7b0015c6c1 100644 --- a/ext/mbstring/tests/zend_multibyte-09.phpt +++ b/ext/mbstring/tests/zend_multibyte-09.phpt @@ -4,6 +4,7 @@ zend multibyte (9) --XFAIL-- https://bugs.php.net/bug.php?id=66582 --INI-- +error_reporting=E_ALL & ~E_DEPRECATED zend.multibyte=On zend.script_encoding=cp1251 mbstring.internal_encoding=UTF-8 diff --git a/ext/mbstring/tests/zend_multibyte-10.phpt b/ext/mbstring/tests/zend_multibyte-10.phpt index 139d973b95..712757c8a7 100644 --- a/ext/mbstring/tests/zend_multibyte-10.phpt +++ b/ext/mbstring/tests/zend_multibyte-10.phpt @@ -1,6 +1,8 @@ --TEST-- zend multibyte (10) --SKIPIF-- +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- zend.multibyte=1 --FILE-- diff --git a/ext/mbstring/tests/zend_multibyte-11.phpt b/ext/mbstring/tests/zend_multibyte-11.phpt index c6e45fa5cd..69624ae006 100644 --- a/ext/mbstring/tests/zend_multibyte-11.phpt +++ b/ext/mbstring/tests/zend_multibyte-11.phpt @@ -1,6 +1,8 @@ --TEST-- zend multibyte (11) --SKIPIF-- +--XFAIL-- +https://bugs.php.net/bug.php?id=66582 --INI-- zend.multibyte=1 --FILE--