summaryrefslogtreecommitdiff
path: root/src/sp_ifilter.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-09-23 12:23:40 +0200
committerBen Fuhrmannek2021-09-23 12:23:40 +0200
commit54c352c1b5aa08b187dd1e52e544709cad2b0fee (patch)
treed15bf0f484c6baa1f2718e625e0d49f6fb488507 /src/sp_ifilter.c
parent887e1c9d44fbcf5f23a928269034593b8521aaba (diff)
config is stack allocated now + some code improvements (see details)
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible * SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read * execution_depth is re-initialized to 0 for each request * function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1 * execution is actually hooked if recursion protection is enabled * some line breaks were removed to make the code more readable
Diffstat (limited to 'src/sp_ifilter.c')
-rw-r--r--src/sp_ifilter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sp_ifilter.c b/src/sp_ifilter.c
index a475c1e..8099882 100644
--- a/src/sp_ifilter.c
+++ b/src/sp_ifilter.c
@@ -77,12 +77,12 @@ static void sp_register_server_variables(zval *track_vars_array) {
77 svars = Z_ARRVAL_P(track_vars_array); 77 svars = Z_ARRVAL_P(track_vars_array);
78 78
79 79
80 if (SNUFFLEUPAGUS_G(config).server_encode) { 80 if (SPCFG(server_encode)) {
81 sp_server_encode(svars, ZEND_STRL("REQUEST_URI")); 81 sp_server_encode(svars, ZEND_STRL("REQUEST_URI"));
82 sp_server_encode(svars, ZEND_STRL("QUERY_STRING")); 82 sp_server_encode(svars, ZEND_STRL("QUERY_STRING"));
83 } 83 }
84 84
85 if (SNUFFLEUPAGUS_G(config).server_strip) { 85 if (SPCFG(server_strip)) {
86 sp_server_strip(svars, ZEND_STRL("PHP_SELF")); 86 sp_server_strip(svars, ZEND_STRL("PHP_SELF"));
87 sp_server_strip(svars, ZEND_STRL("HTTP_HOST")); 87 sp_server_strip(svars, ZEND_STRL("HTTP_HOST"));
88 sp_server_strip(svars, ZEND_STRL("HTTP_USER_AGENT")); 88 sp_server_strip(svars, ZEND_STRL("HTTP_USER_AGENT"));