@@ -742,7 +742,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
742
742
php_error_docref ("ref.mbstring" , E_DEPRECATED , "Use of mbstring.http_input is deprecated" );
743
743
}
744
744
745
- if (!new_value ) {
745
+ if (!new_value || ! ZSTR_LEN ( new_value ) ) {
746
746
const char * encoding = php_get_input_encoding ();
747
747
MBSTRG (http_input_set ) = 0 ;
748
748
_php_mb_ini_mbstring_http_input_set (encoding , strlen (encoding ));
@@ -2716,15 +2716,27 @@ MBSTRING_API HashTable *php_mb_convert_encoding_recursive(HashTable *input, cons
2716
2716
ZEND_HASH_FOREACH_KEY_VAL (input , idx , key , entry ) {
2717
2717
/* convert key */
2718
2718
if (key ) {
2719
- key = php_mb_convert_encoding (ZSTR_VAL (key ), ZSTR_LEN (key ), to_encoding , from_encodings , num_from_encodings );
2719
+ zend_string * converted_key = php_mb_convert_encoding (ZSTR_VAL (key ), ZSTR_LEN (key ), to_encoding , from_encodings , num_from_encodings );
2720
+ if (!converted_key ) {
2721
+ continue ;
2722
+ }
2723
+ key = converted_key ;
2720
2724
}
2721
2725
/* convert value */
2722
2726
ZEND_ASSERT (entry );
2723
2727
try_again :
2724
2728
switch (Z_TYPE_P (entry )) {
2725
- case IS_STRING :
2726
- ZVAL_STR (& entry_tmp , php_mb_convert_encoding (Z_STRVAL_P (entry ), Z_STRLEN_P (entry ), to_encoding , from_encodings , num_from_encodings ));
2729
+ case IS_STRING : {
2730
+ zend_string * converted_key = php_mb_convert_encoding (Z_STRVAL_P (entry ), Z_STRLEN_P (entry ), to_encoding , from_encodings , num_from_encodings );
2731
+ if (!converted_key ) {
2732
+ if (key ) {
2733
+ zend_string_release (key );
2734
+ }
2735
+ continue ;
2736
+ }
2737
+ ZVAL_STR (& entry_tmp , converted_key );
2727
2738
break ;
2739
+ }
2728
2740
case IS_NULL :
2729
2741
case IS_TRUE :
2730
2742
case IS_FALSE :
0 commit comments