@@ -844,8 +844,7 @@ static inline int ct_eval_func_call(
844
844
|| zend_string_equals_literal (name , "urldecode" )
845
845
|| zend_string_equals_literal (name , "rawurlencode" )
846
846
|| zend_string_equals_literal (name , "rawurldecode" )
847
- || zend_string_equals_literal (name , "strtoupper" )
848
- || zend_string_equals_literal (name , "strtolower" )
847
+ || zend_string_equals_literal (name , "php_uname" )
849
848
|| zend_string_equals_literal (name , "dirname" )
850
849
|| zend_string_equals_literal (name , "crc32" )) {
851
850
if (Z_TYPE_P (args [0 ]) != IS_STRING ) {
@@ -872,7 +871,7 @@ static inline int ct_eval_func_call(
872
871
} ZEND_HASH_FOREACH_END ();
873
872
/* pass */
874
873
} else if (zend_string_equals_literal (name , "implode" )
875
- || zend_string_equals_literal (name , "array_unique" )) {
874
+ || zend_string_equals_literal (name , "array_unique" )) {
876
875
zval * entry ;
877
876
878
877
if (Z_TYPE_P (args [0 ]) != IS_ARRAY ) {
@@ -916,6 +915,11 @@ static inline int ct_eval_func_call(
916
915
|| (Z_TYPE_P (args [1 ]) != IS_LONG )) {
917
916
return FAILURE ;
918
917
}
918
+ if (Z_LVAL_P (args [1 ]) < 1 ) {
919
+ // levels must be >= 1, else we get a ValueError
920
+ return FAILURE ;
921
+ }
922
+
919
923
/* pass */
920
924
} else if (zend_string_equals_literal (name , "trim" )
921
925
|| zend_string_equals_literal (name , "rtrim" )
@@ -1015,6 +1019,7 @@ static inline int ct_eval_func_call(
1015
1019
}
1016
1020
}
1017
1021
/* pass */
1022
+ // todo: version_compare with 3 arguments got removed, as we should add a proper check for the comperator, else we hide a ValueError
1018
1023
} else if (zend_string_equals_literal (name , "str_replace" )) {
1019
1024
if (Z_TYPE_P (args [0 ]) != IS_STRING
1020
1025
|| Z_TYPE_P (args [1 ]) != IS_STRING
0 commit comments