diff options
Diffstat (limited to 'src/sp_wrapper.c')
| -rw-r--r-- | src/sp_wrapper.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sp_wrapper.c b/src/sp_wrapper.c index 7610114..1538e33 100644 --- a/src/sp_wrapper.c +++ b/src/sp_wrapper.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #include "php_snuffleupagus.h" | 1 | #include "php_snuffleupagus.h" |
| 2 | 2 | ||
| 3 | static bool wrapper_is_whitelisted(const zend_string *const zs) { | 3 | static bool wrapper_is_whitelisted(const zend_string *const zs) { |
| 4 | const sp_list_node *list = SNUFFLEUPAGUS_G(config).config_wrapper->whitelist; | 4 | const sp_list_node *list = SPCFG(wrapper).whitelist; |
| 5 | 5 | ||
| 6 | if (!zs) { | 6 | if (!zs) { |
| 7 | return false; // LCOV_EXCL_LINE | 7 | return false; // LCOV_EXCL_LINE |
| @@ -38,8 +38,7 @@ void sp_disable_wrapper() { | |||
| 38 | 38 | ||
| 39 | zend_hash_destroy(orig_complete); | 39 | zend_hash_destroy(orig_complete); |
| 40 | pefree(orig_complete, 1); | 40 | pefree(orig_complete, 1); |
| 41 | SNUFFLEUPAGUS_G(config).config_wrapper->num_wrapper = | 41 | SPCFG(wrapper).num_wrapper = zend_hash_num_elements(orig); |
| 42 | zend_hash_num_elements(orig); | ||
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | PHP_FUNCTION(sp_stream_wrapper_register) { | 44 | PHP_FUNCTION(sp_stream_wrapper_register) { |
| @@ -53,9 +52,7 @@ PHP_FUNCTION(sp_stream_wrapper_register) { | |||
| 53 | // LCOV_EXCL_BR_END | 52 | // LCOV_EXCL_BR_END |
| 54 | 53 | ||
| 55 | if (wrapper_is_whitelisted(protocol_name)) { | 54 | if (wrapper_is_whitelisted(protocol_name)) { |
| 56 | orig_handler = zend_hash_str_find_ptr( | 55 | orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("stream_wrapper_register")); |
| 57 | SNUFFLEUPAGUS_G(sp_internal_functions_hook), "stream_wrapper_register", | ||
| 58 | sizeof("stream_wrapper_register") - 1); | ||
| 59 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 56 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
| 60 | } | 57 | } |
| 61 | } | 58 | } |
