diff options
Diffstat (limited to 'src/sp_disabled_functions.c')
| -rw-r--r-- | src/sp_disabled_functions.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index fa9d625..07c8696 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c | |||
| @@ -5,9 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) | 6 | ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) |
| 7 | 7 | ||
| 8 | 8 | char* get_complete_function_path(zend_execute_data const* const execute_data) { | |
| 9 | char* get_complete_function_path( | ||
| 10 | zend_execute_data const* const execute_data) { | ||
| 11 | if (zend_is_executing() && !EG(current_execute_data)->func) { | 9 | if (zend_is_executing() && !EG(current_execute_data)->func) { |
| 12 | return NULL; | 10 | return NULL; |
| 13 | } | 11 | } |
| @@ -469,6 +467,10 @@ ZEND_FUNCTION(eval_blacklist_callback) { | |||
| 469 | void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS); | 467 | void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS); |
| 470 | const char* current_function_name = get_active_function_name(TSRMLS_C); | 468 | const char* current_function_name = get_active_function_name(TSRMLS_C); |
| 471 | 469 | ||
| 470 | if (true == check_is_in_eval_whitelist(current_function_name)) { | ||
| 471 | goto whitelisted; | ||
| 472 | } | ||
| 473 | |||
| 472 | if (SNUFFLEUPAGUS_G(in_eval) > 0) { | 474 | if (SNUFFLEUPAGUS_G(in_eval) > 0) { |
| 473 | const char* filename = get_eval_filename(zend_get_executed_filename()); | 475 | const char* filename = get_eval_filename(zend_get_executed_filename()); |
| 474 | const int line_number = zend_get_executed_lineno(TSRMLS_C); | 476 | const int line_number = zend_get_executed_lineno(TSRMLS_C); |
| @@ -484,6 +486,7 @@ ZEND_FUNCTION(eval_blacklist_callback) { | |||
| 484 | } | 486 | } |
| 485 | } | 487 | } |
| 486 | 488 | ||
| 489 | whitelisted: | ||
| 487 | orig_handler = zend_hash_str_find_ptr( | 490 | orig_handler = zend_hash_str_find_ptr( |
| 488 | SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook), current_function_name, | 491 | SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook), current_function_name, |
| 489 | strlen(current_function_name)); | 492 | strlen(current_function_name)); |
