diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2021-03-22 13:21:07 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2021-03-23 13:12:19 +0100 |
commit | 688e56d0ac6446dcdac2621c26586eb2de92f9b0 (patch) | |
tree | b1d11c253ca5b4ca35548b8ba2cc77140033ecac | |
parent | 838951c2d6612efbf6adeb5b1abc7fced808dc39 (diff) | |
download | php-git-688e56d0ac6446dcdac2621c26586eb2de92f9b0.tar.gz |
Properly initialize PS(mod) on RINIT
We need to do that in case a user handler has been set. However, we
can't do that in `php_rinit_session_globals()` since that function is
called by PHP function `session_destroy()` too, but in that case we
don't want to reset PS(mod).
Closes GH-6795.
-rw-r--r-- | ext/session/session.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index ea9a1eede9..8fb6dd2cd5 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -2855,7 +2855,8 @@ static int php_rinit_session(zend_bool auto_start) /* {{{ */ { php_rinit_session_globals(); - if (PS(mod) == NULL) { + PS(mod) = NULL; + { char *value; value = zend_ini_string("session.save_handler", sizeof("session.save_handler") - 1, 0); |