diff options
Diffstat (limited to 'src/sp_utils.c')
| -rw-r--r-- | src/sp_utils.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c index 949d6ba..c4209de 100644 --- a/src/sp_utils.c +++ b/src/sp_utils.c | |||
| @@ -123,9 +123,7 @@ static int construct_filename(char* filename, | |||
| 123 | return 0; | 123 | return 0; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | int sp_log_request(const zend_string* restrict folder, | 126 | int sp_log_request(const zend_string* restrict folder, const zend_string* restrict text_repr) { |
| 127 | const zend_string* restrict text_repr, | ||
| 128 | char const* const from) { | ||
| 129 | FILE* file; | 127 | FILE* file; |
| 130 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); | 128 | const char* current_filename = zend_get_executed_filename(TSRMLS_C); |
| 131 | const int current_line = zend_get_executed_lineno(TSRMLS_C); | 129 | const int current_line = zend_get_executed_lineno(TSRMLS_C); |
| @@ -146,7 +144,7 @@ int sp_log_request(const zend_string* restrict folder, | |||
| 146 | return -1; | 144 | return -1; |
| 147 | } | 145 | } |
| 148 | 146 | ||
| 149 | fprintf(file, "RULE: sp%s%s\n", from, ZSTR_VAL(text_repr)); | 147 | fprintf(file, "RULE: %s\n", ZSTR_VAL(text_repr)); |
| 150 | 148 | ||
| 151 | fprintf(file, "FILE: %s:%d\n", current_filename, current_line); | 149 | fprintf(file, "FILE: %s:%d\n", current_filename, current_line); |
| 152 | 150 | ||
| @@ -285,8 +283,7 @@ void sp_log_disable(const char* restrict path, const char* restrict arg_name, | |||
| 285 | const int sim = config_node->simulation; | 283 | const int sim = config_node->simulation; |
| 286 | 284 | ||
| 287 | if (dump) { | 285 | if (dump) { |
| 288 | sp_log_request(config_node->dump, config_node->textual_representation, | 286 | sp_log_request(config_node->dump, config_node->textual_representation); |
| 289 | SP_TOKEN_DISABLE_FUNC); | ||
| 290 | } | 287 | } |
| 291 | if (arg_name) { | 288 | if (arg_name) { |
| 292 | char* char_repr = NULL; | 289 | char* char_repr = NULL; |
| @@ -329,8 +326,7 @@ void sp_log_disable_ret(const char* restrict path, | |||
| 329 | char* char_repr = NULL; | 326 | char* char_repr = NULL; |
| 330 | 327 | ||
| 331 | if (dump) { | 328 | if (dump) { |
| 332 | sp_log_request(dump, config_node->textual_representation, | 329 | sp_log_request(dump, config_node->textual_representation); |
| 333 | SP_TOKEN_DISABLE_FUNC); | ||
| 334 | } | 330 | } |
| 335 | if (ret_value) { | 331 | if (ret_value) { |
| 336 | char_repr = zend_string_to_char(ret_value); | 332 | char_repr = zend_string_to_char(ret_value); |
| @@ -479,7 +475,6 @@ void unhook_functions(HashTable *ht) { | |||
| 479 | 475 | ||
| 480 | bool check_is_in_eval_whitelist(const zend_string* const function_name) { | 476 | bool check_is_in_eval_whitelist(const zend_string* const function_name) { |
| 481 | const sp_list_node* it = SNUFFLEUPAGUS_G(config).config_eval->whitelist; | 477 | const sp_list_node* it = SNUFFLEUPAGUS_G(config).config_eval->whitelist; |
| 482 | |||
| 483 | if (!it) { | 478 | if (!it) { |
| 484 | return false; | 479 | return false; |
| 485 | } | 480 | } |
