diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp_wrapper.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/sp_wrapper.c b/src/sp_wrapper.c index 1538e33..9eb5cbc 100644 --- a/src/sp_wrapper.c +++ b/src/sp_wrapper.c | |||
| @@ -44,14 +44,12 @@ void sp_disable_wrapper() { | |||
| 44 | PHP_FUNCTION(sp_stream_wrapper_register) { | 44 | PHP_FUNCTION(sp_stream_wrapper_register) { |
| 45 | zif_handler orig_handler; | 45 | zif_handler orig_handler; |
| 46 | zend_string *protocol_name = NULL; | 46 | zend_string *protocol_name = NULL; |
| 47 | zval *params = NULL; | ||
| 48 | uint32_t param_count = 0; | ||
| 47 | 49 | ||
| 48 | // LCOV_EXCL_BR_START | 50 | zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "S*", &protocol_name, ¶ms, ¶m_count); |
| 49 | ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 2, EX_NUM_ARGS()); | 51 | // ignore proper arguments here and just let the original handler deal with it |
| 50 | Z_PARAM_STR(protocol_name); | 52 | if (!protocol_name || wrapper_is_whitelisted(protocol_name)) { |
| 51 | ZEND_PARSE_PARAMETERS_END_EX((void)0); | ||
| 52 | // LCOV_EXCL_BR_END | ||
| 53 | |||
| 54 | if (wrapper_is_whitelisted(protocol_name)) { | ||
| 55 | orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("stream_wrapper_register")); | 53 | orig_handler = zend_hash_str_find_ptr(SPG(sp_internal_functions_hook), ZEND_STRL("stream_wrapper_register")); |
| 56 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); | 54 | orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); |
| 57 | } | 55 | } |
