From 840479e06f1a3ce94f106b4978c80dc104321810 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 26 Dec 2018 13:17:36 +0100 Subject: Fix the build for php7.0 We only want to prevent crash/infinite recursion, we don't really care about the error/warning messages. --- src/sp_session.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/sp_session.c') diff --git a/src/sp_session.c b/src/sp_session.c index bd11557..22b6688 100644 --- a/src/sp_session.c +++ b/src/sp_session.c @@ -93,6 +93,16 @@ static void sp_hook_session_module() { } static PHP_INI_MH(sp_OnUpdateSaveHandler) { +#if PHP_VERSION_ID < 70100 + /* PHP7.0 doesn't handle well recusively set session handlers */ + if (stage == PHP_INI_STAGE_RUNTIME && + SESSION_G(session_status) == php_session_none && s_original_mod && + zend_string_equals_literal(new_value, "user") == 0 && + strcmp(((ps_module *)s_original_mod)->s_name, "user") == 0) { + return SUCCESS; + } +#endif + SESSION_G(mod) = s_original_mod; int r = old_OnUpdateSaveHandler(entry, new_value, mh_arg1, mh_arg2, mh_arg3, -- cgit v1.3