summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sp_config_keywords.c9
-rw-r--r--src/sp_session.c11
2 files changed, 2 insertions, 18 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c
index 138da75..3e2b156 100644
--- a/src/sp_config_keywords.c
+++ b/src/sp_config_keywords.c
@@ -39,15 +39,6 @@ SP_PARSE_FN(parse_session) {
39 39
40 SP_PROCESS_CONFIG_KEYWORDS_ERR(); 40 SP_PROCESS_CONFIG_KEYWORDS_ERR();
41 41
42#if (!HAVE_PHP_SESSION || defined(COMPILE_DL_SESSION))
43 sp_log_err("config",
44 "You're trying to use the session cookie encryption feature "
45 "on line %zu without having session support statically built into PHP. "
46 "This isn't supported, see "
47 "https://github.com/jvoisin/snuffleupagus/issues/278 for details.", parsed_rule->lineno);
48 return SP_PARSER_ERROR;
49#endif
50
51 if (cfg->encrypt) { 42 if (cfg->encrypt) {
52 if (!SPCFG(cookies_env_var)) { 43 if (!SPCFG(cookies_env_var)) {
53 sp_log_err("config", "You're trying to use the session cookie encryption feature " 44 sp_log_err("config", "You're trying to use the session cookie encryption feature "
diff --git a/src/sp_session.c b/src/sp_session.c
index 214aa85..6335838 100644
--- a/src/sp_session.c
+++ b/src/sp_session.c
@@ -1,7 +1,5 @@
1#include "php_snuffleupagus.h" 1#include "php_snuffleupagus.h"
2 2
3#if (HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION))
4
5#ifdef ZTS 3#ifdef ZTS
6static ts_rsrc_id session_globals_id = 0; 4static ts_rsrc_id session_globals_id = 0;
7#define SESSION_G(v) ZEND_TSRMG(session_globals_id, php_ps_globals *, v) 5#define SESSION_G(v) ZEND_TSRMG(session_globals_id, php_ps_globals *, v)
@@ -10,7 +8,7 @@ ZEND_TSRMLS_CACHE_EXTERN();
10#endif 8#endif
11#else 9#else
12static php_ps_globals *session_globals = NULL; 10static php_ps_globals *session_globals = NULL;
13#define SESSION_G(v) (ps_globals.v) 11#define SESSION_G(v) (session_globals->v)
14#endif 12#endif
15 13
16static ps_module *s_module; 14static ps_module *s_module;
@@ -138,6 +136,7 @@ void hook_session() {
138 zend_module_entry *module; 136 zend_module_entry *module;
139 137
140 if ((module = zend_hash_str_find_ptr(&module_registry, ZEND_STRL("session"))) == NULL) { 138 if ((module = zend_hash_str_find_ptr(&module_registry, ZEND_STRL("session"))) == NULL) {
139 sp_log_err("session", "You are trying to use session encryption or session ID restrictions, but your PHP installation has no session support. Please install the PHP session module or recompile PHP with session support.");
141 return; // LCOV_EXCL_LINE 140 return; // LCOV_EXCL_LINE
142 } 141 }
143 142
@@ -166,9 +165,3 @@ void hook_session() {
166 165
167 sp_hook_session_module(); 166 sp_hook_session_module();
168} 167}
169
170#else
171
172void hook_session() {}
173
174#endif // HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)