summaryrefslogtreecommitdiff
path: root/src/sp_disabled_functions.c
diff options
context:
space:
mode:
authorjvoisin2021-01-30 21:19:29 +0100
committerjvoisin2021-01-30 21:19:29 +0100
commit467f965bf178b1c4d60ddac87af14718f6013bab (patch)
treeca0b616534c2ab2513a99112c213cd87d116f3dd /src/sp_disabled_functions.c
parent484bb5613be54cc37d7b2136eca9e2f4e3eb6f1a (diff)
Improve a bit type diversity
Diffstat (limited to 'src/sp_disabled_functions.c')
-rw-r--r--src/sp_disabled_functions.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c
index 41c9f23..6a559c8 100644
--- a/src/sp_disabled_functions.c
+++ b/src/sp_disabled_functions.c
@@ -532,13 +532,13 @@ static int hook_functions_regexp(const sp_list_node* config) {
532 return SUCCESS; 532 return SUCCESS;
533} 533}
534 534
535static int hook_functions(HashTable* to_hook_ht, HashTable* hooked_ht) { 535static void hook_functions(HashTable* to_hook_ht, HashTable* hooked_ht) {
536 zend_string* key; 536 zend_string* key;
537 zval* value; 537 zval* value;
538 538
539 ZEND_HASH_FOREACH_STR_KEY_VAL(to_hook_ht, key, value) { 539 ZEND_HASH_FOREACH_STR_KEY_VAL(to_hook_ht, key, value) {
540 bool hooked = !HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook, 540 bool hooked = HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook,
541 PHP_FN(check_disabled_function)); 541 PHP_FN(check_disabled_function));
542 bool is_builtin = 542 bool is_builtin =
543 check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data); 543 check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data);
544 if (hooked || is_builtin) { 544 if (hooked || is_builtin) {
@@ -547,7 +547,6 @@ static int hook_functions(HashTable* to_hook_ht, HashTable* hooked_ht) {
547 } 547 }
548 } 548 }
549 ZEND_HASH_FOREACH_END(); 549 ZEND_HASH_FOREACH_END();
550 return SUCCESS;
551} 550}
552 551
553ZEND_FUNCTION(eval_blacklist_callback) { 552ZEND_FUNCTION(eval_blacklist_callback) {
@@ -595,13 +594,11 @@ int hook_disabled_functions(void) {
595 594
596 int ret = SUCCESS; 595 int ret = SUCCESS;
597 596
598 ret |= 597 hook_functions(SNUFFLEUPAGUS_G(config).config_disabled_functions,
599 hook_functions(SNUFFLEUPAGUS_G(config).config_disabled_functions, 598 SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked);
600 SNUFFLEUPAGUS_G(config).config_disabled_functions_hooked);
601 599
602 ret |= hook_functions( 600 hook_functions(SNUFFLEUPAGUS_G(config).config_disabled_functions_ret,
603 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret, 601 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret_hooked);
604 SNUFFLEUPAGUS_G(config).config_disabled_functions_ret_hooked);
605 602
606 ret |= hook_functions_regexp( 603 ret |= hook_functions_regexp(
607 SNUFFLEUPAGUS_G(config) 604 SNUFFLEUPAGUS_G(config)