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