Skip to content

Commit 8bbd095

Browse files
author
Yasuo Ohgaki
committed
Fix Bug #72992 mbstring.internal_encoding doesn't inherit default_charset
1 parent dad7936 commit 8bbd095

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/mbstring/mbstring.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
12601260
const mbfl_encoding **list;
12611261
size_t size;
12621262

1263-
if (!new_value) {
1263+
if (!new_value || !new_value_length) {
12641264
if (MBSTRG(http_input_list)) {
12651265
pefree(MBSTRG(http_input_list), 1);
12661266
}
@@ -1328,7 +1328,7 @@ int _php_mb_ini_mbstring_internal_encoding_set(const char *new_value, uint new_v
13281328
{
13291329
const mbfl_encoding *encoding;
13301330

1331-
if (!new_value || new_value_length == 0 || !(encoding = mbfl_name2encoding(new_value))) {
1331+
if (!new_value || !new_value_length || !(encoding = mbfl_name2encoding(new_value))) {
13321332
/* falls back to UTF-8 if an unknown encoding name is given */
13331333
encoding = mbfl_no2encoding(mbfl_no_encoding_utf8);
13341334
}
@@ -1361,7 +1361,7 @@ static PHP_INI_MH(OnUpdate_mbstring_internal_encoding)
13611361
}
13621362

13631363
if (stage & (PHP_INI_STAGE_STARTUP | PHP_INI_STAGE_SHUTDOWN | PHP_INI_STAGE_RUNTIME)) {
1364-
if (new_value_length) {
1364+
if (new_value && new_value_length) {
13651365
return _php_mb_ini_mbstring_internal_encoding_set(new_value, new_value_length TSRMLS_CC);
13661366
} else {
13671367
return _php_mb_ini_mbstring_internal_encoding_set(get_internal_encoding(TSRMLS_C), strlen(get_internal_encoding(TSRMLS_C))+1 TSRMLS_CC);

0 commit comments

Comments
 (0)