diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2016-11-15 11:12:26 +0900 |
---|---|---|
committer | Joe Watkins <krakjoe@php.net> | 2016-11-16 05:08:29 +0000 |
commit | 3d6e922367fc85fd175394b53946604807466011 (patch) | |
tree | e7c477c3ed69654359167cf3cb334f7c603b14c1 /ext/session/mod_user.c | |
parent | 7b29c3fba6678ea84285aa60b2494cc79f388bbb (diff) | |
download | php-git-3d6e922367fc85fd175394b53946604807466011.tar.gz |
Refactor and cleanup implementation.
Diffstat (limited to 'ext/session/mod_user.c')
-rw-r--r-- | ext/session/mod_user.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c index 0cdbaf96f9..9755f0d5c4 100644 --- a/ext/session/mod_user.c +++ b/ext/session/mod_user.c @@ -30,12 +30,20 @@ ps_module ps_mod_user = { static void ps_call_handler(zval *func, int argc, zval *argv, zval *retval) { int i; + if (PS(in_save_handler)) { + PS(in_save_handler) = 0; + ZVAL_UNDEF(retval); + php_error_docref(NULL, E_WARNING, "Cannot call save handler function recursive manner"); + return; + } + PS(in_save_handler) = 1; if (call_user_function(EG(function_table), NULL, func, retval, argc, argv) == FAILURE) { zval_ptr_dtor(retval); ZVAL_UNDEF(retval); } else if (Z_ISUNDEF_P(retval)) { ZVAL_NULL(retval); } + PS(in_save_handler) = 0; for (i = 0; i < argc; i++) { zval_ptr_dtor(&argv[i]); } |