summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index 8e96085..fa9d625 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -5,7 +5,8 @@
5 5
6ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus) 6ZEND_DECLARE_MODULE_GLOBALS(snuffleupagus)
7 7
8static char* get_complete_function_path( 8
9char* get_complete_function_path(
9 zend_execute_data const* const execute_data) { 10 zend_execute_data const* const execute_data) {
10 if (zend_is_executing() && !EG(current_execute_data)->func) { 11 if (zend_is_executing() && !EG(current_execute_data)->func) {
11 return NULL; 12 return NULL;
@@ -107,6 +108,7 @@ static const sp_list_node* get_config_node(const char* builtin_name) {
107 return SNUFFLEUPAGUS_G(config) 108 return SNUFFLEUPAGUS_G(config)
108 .config_disabled_constructs->construct_include; 109 .config_disabled_constructs->construct_include;
109 } 110 }
111 ZEND_ASSUME(0);
110 return NULL; // This should never happen. 112 return NULL; // This should never happen.
111} 113}
112 114
@@ -463,7 +465,7 @@ static int hook_functions(const sp_list_node* config) {
463 return SUCCESS; 465 return SUCCESS;
464} 466}
465 467
466ZEND_FUNCTION(eval_filter_callback) { 468ZEND_FUNCTION(eval_blacklist_callback) {
467 void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS); 469 void (*orig_handler)(INTERNAL_FUNCTION_PARAMETERS);
468 const char* current_function_name = get_active_function_name(TSRMLS_C); 470 const char* current_function_name = get_active_function_name(TSRMLS_C);
469 471
@@ -483,7 +485,7 @@ ZEND_FUNCTION(eval_filter_callback) {
483 } 485 }
484 486
485 orig_handler = zend_hash_str_find_ptr( 487 orig_handler = zend_hash_str_find_ptr(
486 SNUFFLEUPAGUS_G(sp_eval_filter_functions_hook), current_function_name, 488 SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook), current_function_name,
487 strlen(current_function_name)); 489 strlen(current_function_name));
488 orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); 490 orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
489} 491}
@@ -503,8 +505,8 @@ int hook_disabled_functions(void) {
503 505
504 while (it) { 506 while (it) {
505 hook_function((char*)it->data, 507 hook_function((char*)it->data,
506 SNUFFLEUPAGUS_G(sp_eval_filter_functions_hook), 508 SNUFFLEUPAGUS_G(sp_eval_blacklist_functions_hook),
507 PHP_FN(eval_filter_callback), false); 509 PHP_FN(eval_blacklist_callback), false);
508 it = it->next; 510 it = it->next;
509 } 511 }
510 } 512 }