summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-11-30 19:38:34 +0100
committerBen Fuhrmannek2021-11-30 19:38:34 +0100
commit6095651e2caa729ff56ae5a53c908b09e5f7dc29 (patch)
tree0bb9907ea7142701c206b00a135c0c0d96c9ca39 /src/sp_disabled_functions.c
parenta870b1547fceb5f58d56f1a1646ab1e897d28238 (diff)
PHP 8.1 compatibility with streams/includes + fix for ticks
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index 4ef72bf..a3b3e99 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -498,11 +498,9 @@ static int hook_functions_regexp(const sp_list_node* config) {
498 assert(function_name || function_name_regexp); 498 assert(function_name || function_name_regexp);
499 499
500 if (function_name) { 500 if (function_name) {
501 HOOK_FUNCTION(ZSTR_VAL(function_name), disabled_functions_hook, 501 HOOK_FUNCTION(ZSTR_VAL(function_name), disabled_functions_hook, PHP_FN(check_disabled_function));
502 PHP_FN(check_disabled_function));
503 } else { 502 } else {
504 HOOK_FUNCTION_BY_REGEXP(function_name_regexp, disabled_functions_hook, 503 HOOK_FUNCTION_BY_REGEXP(function_name_regexp, disabled_functions_hook, PHP_FN(check_disabled_function));
505 PHP_FN(check_disabled_function));
506 } 504 }
507 505
508 config = config->next; 506 config = config->next;
@@ -515,10 +513,8 @@ static void hook_functions(HashTable* to_hook_ht, HashTable* hooked_ht) {
515 zval* value; 513 zval* value;
516 514
517 ZEND_HASH_FOREACH_STR_KEY_VAL(to_hook_ht, key, value) { 515 ZEND_HASH_FOREACH_STR_KEY_VAL(to_hook_ht, key, value) {
518 bool hooked = HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook, 516 bool hooked = HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook, PHP_FN(check_disabled_function));
519 PHP_FN(check_disabled_function)); 517 bool is_builtin = check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data);
520 bool is_builtin =
521 check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data);
522 if (hooked || is_builtin) { 518 if (hooked || is_builtin) {
523 zend_symtable_add_new(hooked_ht, key, value); 519 zend_symtable_add_new(hooked_ht, key, value);
524 zend_hash_del(to_hook_ht, key); 520 zend_hash_del(to_hook_ht, key);