]> granicus.if.org Git - php/commitdiff
Add missing E_DEPRECATED error for https://wiki.php.net/rfc/default_encoding
authorYasuo Ohgaki <yohgaki@php.net>
Wed, 12 Mar 2014 08:54:22 +0000 (17:54 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Wed, 12 Mar 2014 08:54:22 +0000 (17:54 +0900)
19 files changed:
UPGRADING
ext/iconv/iconv.c
ext/iconv/tests/iconv_encoding_basic.phpt
ext/iconv/tests/iconv_get_encoding_basic.phpt
ext/iconv/tests/iconv_ini_encoding.phpt
ext/iconv/tests/iconv_set_encoding_variation.phpt
ext/iconv/tests/iconv_strpos_basic.phpt
ext/iconv/tests/iconv_strpos_variation5.phpt
ext/iconv/tests/iconv_strrpos_basic.phpt
ext/mbstring/mbstring.c
ext/mbstring/tests/bug48697.phpt
ext/mbstring/tests/ini_encoding.phpt
ext/mbstring/tests/zend_multibyte-02.phpt
ext/mbstring/tests/zend_multibyte-06.phpt
ext/mbstring/tests/zend_multibyte-07.phpt
ext/mbstring/tests/zend_multibyte-08.phpt
ext/mbstring/tests/zend_multibyte-09.phpt
ext/mbstring/tests/zend_multibyte-10.phpt
ext/mbstring/tests/zend_multibyte-11.phpt

index 4c05ee4391072b1d5b1752e340b06d29adf6a311..c9b189da665ed5f6d42e78fecef67cddfe97b724 100755 (executable)
--- 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
 ========================================
index 87ad5eeaab0c054615db7cb1b2d307806002d7db..57aed6b4b032819ba33f10ad6eb625c53d53eb9a 100644 (file)
@@ -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);
index 746858161c817fece5681778fabfdf3094b0b06d..35314f1e690501d6f0c4f1637545233df3278e5d 100644 (file)
@@ -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
index 83efd1586dbe87b764f9a903e7f57d221d70342a..84ee932e1056808876ec213414e2aa3c0c56e30c 100644 (file)
@@ -5,6 +5,8 @@ Oystein Rose <orose@redpill-linpro.com>
 #PHPTestFest2009 Norway 2009-06-09 \o/
 --SKIPIF--
 <?php if (!extension_loaded("iconv")) { echo 'skip extension not available'; } ?>
+--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 --FILE--
 <?php
 
index b9a69824e1d2fead799acf0bd52dbd34e49aadca..2d02b1c55a4bece8a1fc869411d0df64ee0c862b 100644 (file)
@@ -3,6 +3,7 @@ Encoding INI test
 --SKIPIF--
 <?php extension_loaded('iconv') or die('skip mbstring not available'); ?>
 --INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 default_charset=ISO-8859-1
 internal_encoding=
 input_encoding=
index e239c6c18bfe088a8f2ad5c5be0a4919ef10c4db..4e097569fda8051f76269aa7de91fc47a97c1cf2 100644 (file)
@@ -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--
 <?php
 /* Prototype  : bool iconv_set_encoding(string type, string charset)
index 1604465f1dcfc2e20142099e699b8bd14dd7aa31..25f8f1b1fd0ef759f7001af603ee401666785d24 100644 (file)
@@ -5,6 +5,8 @@ Test iconv_strpos() function : basic functionality
 extension_loaded('iconv') or die('skip');
 function_exists('iconv_strpos') or die("skip iconv_strpos() is not available in this build");
 ?>
+--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 --FILE--
 <?php
 /* Prototype  : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
index 57a7a90ee4def050a68000a8f55181f5584b678b..3db0634215d8887283bb6ff3ee01ffea166fb9cd 100644 (file)
@@ -5,6 +5,8 @@ Test iconv_strpos() function : usage variations - Pass different integers as $of
 extension_loaded('iconv') or die('skip');
 function_exists('iconv_strpos') or die("skip iconv_strpos() is not available in this build");
 ?>
+--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 --FILE--
 <?php
 /* Prototype  : int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
index e2756810570cc39c9ae47baa660807e476801b85..3d34a23f11645727434ed389504a12ee64050f38 100644 (file)
@@ -5,6 +5,8 @@ Test iconv_strrpos() function : basic functionality
 extension_loaded('iconv') or die('skip');
 function_exists('iconv_strrpos') or die("skip iconv_strrpos() is not available in this build");
 ?>
+--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 --FILE--
 <?php
 /* Prototype  : proto int iconv_strrpos(string haystack, string needle [, string charset])
index e7f08a32564883b6f9e92de1cea8fc9a1251fb66..001f40a5f98733f15a17ce46948fd593db2bdf6a 100644 (file)
@@ -1256,6 +1256,10 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
        MBSTRG(http_input_list) = list;
        MBSTRG(http_input_list_size) = size;
 
+       if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
+               php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_input is deprecated");
+       }
+
        return SUCCESS;
 }
 /* }}} */
@@ -1282,6 +1286,11 @@ static PHP_INI_MH(OnUpdate_mbstring_http_output)
        }
        MBSTRG(http_output_encoding) = encoding;
        MBSTRG(current_http_output_encoding) = encoding;
+
+       if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
+               php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.http_output is deprecated");
+       }
+
        return SUCCESS;
 }
 /* }}} */
@@ -1315,11 +1324,15 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
 /* {{{ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding) */
 static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
 {
+       if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
+               php_error_docref("ref.mbstring" TSRMLS_CC, E_DEPRECATED, "Use of mbstring.internal_encoding is deprecated");
+       }
+
        if (OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC) == FAILURE) {
                return FAILURE;
        }
-       if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN
-                       || stage == PHP_INI_STAGE_RUNTIME) {
+
+       if (stage & (PHP_INI_STAGE_STARTUP | PHP_INI_STAGE_SHUTDOWN | PHP_INI_STAGE_RUNTIME)) {
                if (new_value_length) {
                        return _php_mb_ini_mbstring_internal_encoding_set(new_value, new_value_length TSRMLS_CC);
                } else {
index 42bbe9f5a833a206e2f76e8427108ae6669fc6c4..93644a5f05c56869495deb356dd91e2ad7b089c8 100644 (file)
@@ -2,6 +2,8 @@
 Bug #48697 (mb_internal_encoding() value gets reset by parse_str() or mb_parse_str()
 --SKIPIF--
 <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
+--INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 --FILE--
 <?php
 ini_set('mbstring.internal_encoding', 'ISO-8859-15');
index 79a0f3aad47f1373c933ca3f394643125fdd3e60..b9809b2bfe8ecec714597666ef7392edec111c44 100644 (file)
@@ -3,6 +3,7 @@ Encoding INI test
 --SKIPIF--
 <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
 --INI--
+error_reporting=E_ALL & ~E_DEPRECATED
 default_charset=Shift_JIS
 internal_encoding=
 input_encoding=
index ebc10b48beb397812a2b4792bb36a8b74623489e..8a1a57280443e1550e0e37df3e950fe8effc7942 100644 (file)
@@ -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
index e0b4ead545b2fab219738d26cd9445ae156de0f9..1b8adb51861a7121e93f3383cdba077cb344b9ad 100644 (file)
@@ -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
index 08db1d0f70577a77247b331c8443f04dab29dbac..50d4cd95ed3b9e9bdb308cb4d7f39d7f6c75f45e 100644 (file)
@@ -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
index 488e2a00caf8649cbf47b20fe29d3722509953c4..a0989fc562a38fe8b0b6f4d30fbdf3d4ea7ea0d5 100644 (file)
@@ -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
index 8ad00b4e1e4b8f15af4ec3bf6eb9273476825daf..7b0015c6c120a8024dca1c6042923dc38d9e5326 100644 (file)
@@ -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
index 139d973b9551440e403e080fd525c0480a3f7679..712757c8a79f7dc5d1f8ac53837507764f9b8693 100644 (file)
@@ -1,6 +1,8 @@
 --TEST--
 zend multibyte (10)
 --SKIPIF--
+--XFAIL--
+https://bugs.php.net/bug.php?id=66582
 --INI--
 zend.multibyte=1
 --FILE--
index c6e45fa5cd5cca1f9bd83a2d870a9ed8ae0f4c21..69624ae006ad1f3659df533f7a8f9c3a189cfdde 100644 (file)
@@ -1,6 +1,8 @@
 --TEST--
 zend multibyte (11)
 --SKIPIF--
+--XFAIL--
+https://bugs.php.net/bug.php?id=66582
 --INI--
 zend.multibyte=1
 --FILE--