From f4e3a800aa5a243464911fc2e9fa81a7848c57f7 Mon Sep 17 00:00:00 2001 From: xXx-caillou-xXx Date: Sun, 3 Jan 2021 00:11:09 +0100 Subject: Add a check on parameters names Snuffleupagus will now warn when a particular function doesn't have the expected parameters configuration-wise. --- src/sp_var_value.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/sp_var_value.c') diff --git a/src/sp_var_value.c b/src/sp_var_value.c index 986ea2d..126ba0e 100644 --- a/src/sp_var_value.c +++ b/src/sp_var_value.c @@ -68,7 +68,18 @@ static zval *get_var_value(zend_execute_data *ed, const char *var_name, } if (is_param) { - return get_param_var(ed, var_name); + zval *zvalue = get_param_var(ed, var_name); + if (!zvalue) { + const char *complete_function_path = get_complete_function_path(ed); + sp_log_warn("config", + "It seems that you are filtering on a parameter " + "'%s' of the function '%s', but the parameter does " + "not exists.", + var_name, complete_function_path); + efree(complete_function_path); + return NULL; + } + return zvalue; } else { return get_local_var(ed, var_name); } -- cgit v1.3