File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -872,7 +872,7 @@ static inline int ct_eval_func_call(
872
872
} ZEND_HASH_FOREACH_END ();
873
873
/* pass */
874
874
} else if (zend_string_equals_literal (name , "implode" )
875
- || zend_string_equals_literal (name , "array_unique" )) {
875
+ || zend_string_equals_literal (name , "array_unique" )) {
876
876
zval * entry ;
877
877
878
878
if (Z_TYPE_P (args [0 ]) != IS_ARRAY ) {
@@ -916,6 +916,11 @@ static inline int ct_eval_func_call(
916
916
|| (Z_TYPE_P (args [1 ]) != IS_LONG )) {
917
917
return FAILURE ;
918
918
}
919
+ if (Z_LVAL_P (args [1 ]) < 1 ) {
920
+ // levels must be >= 1, else we get a ValueError
921
+ return FAILURE ;
922
+ }
923
+
919
924
/* pass */
920
925
} else if (zend_string_equals_literal (name , "trim" )
921
926
|| zend_string_equals_literal (name , "rtrim" )
@@ -1015,6 +1020,7 @@ static inline int ct_eval_func_call(
1015
1020
}
1016
1021
}
1017
1022
/* pass */
1023
+ // todo: version_compare with 3 arguments got removed, as we should add a proper check for the comperator, else we hide a ValueError
1018
1024
} else if (zend_string_equals_literal (name , "str_replace" )) {
1019
1025
if (Z_TYPE_P (args [0 ]) != IS_STRING
1020
1026
|| Z_TYPE_P (args [1 ]) != IS_STRING
You can’t perform that action at this time.
0 commit comments