diff options
| author | xXx-caillou-xXx | 2021-01-03 00:11:09 +0100 |
|---|---|---|
| committer | jvoisin | 2021-01-04 20:59:46 +0100 |
| commit | f4e3a800aa5a243464911fc2e9fa81a7848c57f7 (patch) | |
| tree | a8e56382c7236cb1371704404a06039a26a7bc8d /src/sp_var_value.c | |
| parent | 48f927e9694fcfd76d9fe97542359c8b0bd0a46d (diff) | |
Add a check on parameters names
Snuffleupagus will now warn when a particular function
doesn't have the expected parameters configuration-wise.
Diffstat (limited to 'src/sp_var_value.c')
| -rw-r--r-- | src/sp_var_value.c | 13 |
1 files changed, 12 insertions, 1 deletions
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, | |||
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | if (is_param) { | 70 | if (is_param) { |
| 71 | return get_param_var(ed, var_name); | 71 | zval *zvalue = get_param_var(ed, var_name); |
| 72 | if (!zvalue) { | ||
| 73 | const char *complete_function_path = get_complete_function_path(ed); | ||
| 74 | sp_log_warn("config", | ||
| 75 | "It seems that you are filtering on a parameter " | ||
| 76 | "'%s' of the function '%s', but the parameter does " | ||
| 77 | "not exists.", | ||
| 78 | var_name, complete_function_path); | ||
| 79 | efree(complete_function_path); | ||
| 80 | return NULL; | ||
| 81 | } | ||
| 82 | return zvalue; | ||
| 72 | } else { | 83 | } else { |
| 73 | return get_local_var(ed, var_name); | 84 | return get_local_var(ed, var_name); |
| 74 | } | 85 | } |
