summaryrefslogtreecommitdiff
path: root/src/sp_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp_wrapper.c')
-rw-r--r--src/sp_wrapper.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/sp_wrapper.c b/src/sp_wrapper.c
index e336a87..fd47dd6 100644
--- a/src/sp_wrapper.c
+++ b/src/sp_wrapper.c
@@ -7,11 +7,11 @@ static bool wrapper_is_whitelisted(const zend_string *zs) {
7 const sp_list_node *list = SNUFFLEUPAGUS_G(config).config_wrapper->whitelist; 7 const sp_list_node *list = SNUFFLEUPAGUS_G(config).config_wrapper->whitelist;
8 8
9 if (!zs) { 9 if (!zs) {
10 return false; 10 return false; // LCOV_EXCL_LINE
11 } 11 }
12 12
13 while (list) { 13 while (list) {
14 if (zend_string_equals_ci(zs, (const zend_string*)list->data)) { 14 if (zend_string_equals_ci(zs, (const zend_string *)list->data)) {
15 return true; 15 return true;
16 } 16 }
17 list = list->next; 17 list = list->next;
@@ -41,23 +41,24 @@ void sp_disable_wrapper() {
41 41
42 zend_hash_destroy(orig_complete); 42 zend_hash_destroy(orig_complete);
43 pefree(orig_complete, 1); 43 pefree(orig_complete, 1);
44 SNUFFLEUPAGUS_G(config).config_wrapper->num_wrapper = zend_hash_num_elements(orig); 44 SNUFFLEUPAGUS_G(config).config_wrapper->num_wrapper =
45 zend_hash_num_elements(orig);
45} 46}
46 47
47PHP_FUNCTION(sp_stream_wrapper_register) { 48PHP_FUNCTION(sp_stream_wrapper_register) {
48 zif_handler orig_handler; 49 zif_handler orig_handler;
49 zend_string *protocol_name = NULL; 50 zend_string *protocol_name = NULL;
50 51
51 // LCOV_EXCL_BR_START 52 // LCOV_EXCL_BR_START
52 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 2, EX_NUM_ARGS()); 53 ZEND_PARSE_PARAMETERS_START_EX(ZEND_PARSE_PARAMS_QUIET, 2, EX_NUM_ARGS());
53 Z_PARAM_STR(protocol_name); 54 Z_PARAM_STR(protocol_name);
54 ZEND_PARSE_PARAMETERS_END_EX((void)0); 55 ZEND_PARSE_PARAMETERS_END_EX((void)0);
55 // LCOV_EXCL_BR_END 56 // LCOV_EXCL_BR_END
56 57
57 if (wrapper_is_whitelisted(protocol_name)) { 58 if (wrapper_is_whitelisted(protocol_name)) {
58 orig_handler = zend_hash_str_find_ptr( 59 orig_handler = zend_hash_str_find_ptr(
59 SNUFFLEUPAGUS_G(sp_internal_functions_hook), 60 SNUFFLEUPAGUS_G(sp_internal_functions_hook), "stream_wrapper_register",
60 "stream_wrapper_register", sizeof("stream_wrapper_register") - 1); 61 sizeof("stream_wrapper_register") - 1);
61 orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU); 62 orig_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU);
62 } 63 }
63} 64}