diff options
| author | xXx-caillou-xXx | 2018-07-13 14:47:49 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-13 12:47:49 +0000 |
| commit | b1bf270b41f94ce2df668be611e5b646397a7a52 (patch) | |
| tree | 8b661feaecb1914c38ac572e51a2b7bedd13b81d /src/sp_disabled_functions.c | |
| parent | e8e5314f44dbbbaf5e421aaad88408ff20c5a248 (diff) | |
Fix hooking on `print`
Diffstat (limited to '')
| -rw-r--r-- | src/sp_disabled_functions.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index f266951..f6e06e4 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c | |||
| @@ -573,14 +573,8 @@ static int hook_functions(HashTable* to_hook_ht, HashTable* hooked_ht) { | |||
| 573 | if (!HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook, | 573 | if (!HOOK_FUNCTION(ZSTR_VAL(key), disabled_functions_hook, |
| 574 | PHP_FN(check_disabled_function)) || | 574 | PHP_FN(check_disabled_function)) || |
| 575 | check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data)) { | 575 | check_is_builtin_name(((sp_list_node*)Z_PTR_P(value))->data)) { |
| 576 | if (zend_string_equals_literal(key, "echo") || | 576 | zend_symtable_add_new(hooked_ht, key, value); |
| 577 | zend_string_equals_literal(key, "print")) { | 577 | zend_hash_del(to_hook_ht, key); |
| 578 | zend_hash_str_add_new(hooked_ht, "echo", strlen("echo"), value); | ||
| 579 | zend_hash_del(to_hook_ht, key); | ||
| 580 | } else { | ||
| 581 | zend_symtable_add_new(hooked_ht, key, value); | ||
| 582 | zend_hash_del(to_hook_ht, key); | ||
| 583 | } | ||
| 584 | } | 578 | } |
| 585 | } | 579 | } |
| 586 | ZEND_HASH_FOREACH_END(); | 580 | ZEND_HASH_FOREACH_END(); |
