summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sp_config.h2
-rw-r--r--src/sp_config_keywords.c4
-rw-r--r--src/sp_disabled_functions.c8
-rw-r--r--src/sp_execute.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/src/sp_config.h b/src/sp_config.h
index cad4234..0877ebb 100644
--- a/src/sp_config.h
+++ b/src/sp_config.h
@@ -82,7 +82,7 @@ typedef struct {
82 pcre *r_ret; 82 pcre *r_ret;
83 sp_php_type ret_type; 83 sp_php_type ret_type;
84 84
85 pcre *regexp; 85 pcre *value_r;
86 char *value; 86 char *value;
87 87
88 char *dump; 88 char *dump;
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index 5e31c41..29f1bfc 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -160,7 +160,7 @@ int parse_disabled_functions(char *line) {
160 {parse_empty, SP_TOKEN_DROP, &(df->drop)}, 160 {parse_empty, SP_TOKEN_DROP, &(df->drop)},
161 {parse_str, SP_TOKEN_HASH, &(df->hash)}, 161 {parse_str, SP_TOKEN_HASH, &(df->hash)},
162 {parse_str, SP_TOKEN_PARAM, &(df->param)}, 162 {parse_str, SP_TOKEN_PARAM, &(df->param)},
163 {parse_regexp, SP_TOKEN_VALUE_REGEXP, &(df->regexp)}, 163 {parse_regexp, SP_TOKEN_VALUE_REGEXP, &(df->value_r)},
164 {parse_str, SP_TOKEN_VALUE, &(df->value)}, 164 {parse_str, SP_TOKEN_VALUE, &(df->value)},
165 {parse_regexp, SP_TOKEN_PARAM_REGEXP, &(df->r_param)}, 165 {parse_regexp, SP_TOKEN_PARAM_REGEXP, &(df->r_param)},
166 {parse_php_type, SP_TOKEN_PARAM_TYPE, &(df->param_type)}, 166 {parse_php_type, SP_TOKEN_PARAM_TYPE, &(df->param_type)},
@@ -183,7 +183,7 @@ int parse_disabled_functions(char *line) {
183 df->enable = true; 183 df->enable = true;
184 } 184 }
185 185
186 if (df->value && df->regexp) { 186 if (df->value && df->value_r) {
187 sp_log_err("config", 187 sp_log_err("config",
188 "Invalid configuration line: 'sp.disabled_functions%s':" 188 "Invalid configuration line: 'sp.disabled_functions%s':"
189 "'.value' and '.regexp' are mutually exclusives on line %zu.", 189 "'.value' and '.regexp' are mutually exclusives on line %zu.",
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index 758978c..0f5f859 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -80,7 +80,7 @@ static bool is_local_var_matching(zend_execute_data *execute_data, const sp_disa
80 } 80 }
81 if (Z_TYPE_P(value) != IS_ARRAY) { 81 if (Z_TYPE_P(value) != IS_ARRAY) {
82 char *var_value_str = sp_convert_to_string(value); 82 char *var_value_str = sp_convert_to_string(value);
83 if (true == sp_match_value(var_value_str, config_node->value, config_node->regexp)) { 83 if (true == sp_match_value(var_value_str, config_node->value, config_node->value_r)) {
84 efree(var_value_str); 84 efree(var_value_str);
85 EG(current_execute_data) = orig_execute_data; 85 EG(current_execute_data) = orig_execute_data;
86 return true; 86 return true;
@@ -214,13 +214,13 @@ bool should_disable(zend_execute_data* execute_data) {
214 if (config_node->param_is_array == true) { 214 if (config_node->param_is_array == true) {
215 if (true == sp_match_array_key_recurse( 215 if (true == sp_match_array_key_recurse(
216 arg_value, config_node->param_array_keys, 216 arg_value, config_node->param_array_keys,
217 config_node->value, config_node->regexp)) { 217 config_node->value, config_node->value_r)) {
218 arg_matched = true; 218 arg_matched = true;
219 break; 219 break;
220 } 220 }
221 } else { // match on all keys, but don't go into subarray 221 } else { // match on all keys, but don't go into subarray
222 if (true == sp_match_array_key(arg_value, config_node->value, 222 if (true == sp_match_array_key(arg_value, config_node->value,
223 config_node->regexp)) { 223 config_node->value_r)) {
224 arg_matched = true; 224 arg_matched = true;
225 break; 225 break;
226 } 226 }
@@ -228,7 +228,7 @@ bool should_disable(zend_execute_data* execute_data) {
228 } else { 228 } else {
229 arg_value_str = sp_convert_to_string(arg_value); 229 arg_value_str = sp_convert_to_string(arg_value);
230 if (true == sp_match_value(arg_value_str, config_node->value, 230 if (true == sp_match_value(arg_value_str, config_node->value,
231 config_node->regexp)) { 231 config_node->value_r)) {
232 arg_matched = true; 232 arg_matched = true;
233 break; 233 break;
234 } 234 }
diff --git a/src/sp_execute.c b/src/sp_execute.c
index 59f6884..fb4a313 100644
--- a/src/sp_execute.c
+++ b/src/sp_execute.c
@@ -37,7 +37,7 @@ static void construct_include_handler(const char * const filename) {
37 37
38 while (config) { 38 while (config) {
39 sp_disabled_function *config_node = (sp_disabled_function*)(config->data); 39 sp_disabled_function *config_node = (sp_disabled_function*)(config->data);
40 if (true == sp_match_value(filename, config_node->value, config_node->regexp)) { 40 if (true == sp_match_value(filename, config_node->value, config_node->value_r)) {
41 if (true == config_node->allow) { 41 if (true == config_node->allow) {
42 return; 42 return;
43 } 43 }