Skip to content

Commit 50662f8

Browse files
committed
A better fix for #55817 (thanks to bjori)
1 parent 5fba3ba commit 50662f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mbstring/mbstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3183,7 +3183,7 @@ PHP_FUNCTION(mb_detect_encoding)
31833183
/* make encoding list */
31843184
list = NULL;
31853185
size = 0;
3186-
if (ZEND_NUM_ARGS() >= 2) {
3186+
if (ZEND_NUM_ARGS() >= 2 && !ZVAL_IS_NULL(encoding_list)) {
31873187
switch (Z_TYPE_P(encoding_list)) {
31883188
case IS_ARRAY:
31893189
if (FAILURE == php_mb_parse_encoding_array(encoding_list, &list, &size, 0 TSRMLS_CC)) {

0 commit comments

Comments
 (0)