diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-07-22 15:42:17 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-07-22 15:42:17 +0400 |
commit | f2a2fcceceed5bb5851b459af9383d0da14a804b (patch) | |
tree | 6e9ac31a58214881ecd1380ba2b739b1dba17ce5 /ext/session/session.c | |
parent | 821b8bbb397a70151bdd039c072757e0f12fad19 (diff) | |
parent | b39f98cf81cce1eae9f665a5c7f82c93e218a577 (diff) | |
download | php-git-f2a2fcceceed5bb5851b459af9383d0da14a804b.tar.gz |
Merge branch 'master' into phpng
* master:
fix nmake snap when ext name is different in target dll
force atoll macro usage on windows
Enable $ replacement in exif, ldap, pdo_pgsql and tidy
See bug #67635
NEWS
NEWS
improve previous, add message during configure
Fixed bug #67635 php links to systemd libraries without using pkg-config
Improve fix for #66608
Fixed segfault with empty break
New added opcodes don't need to be resloved
Update NEWS
Update NEWS
Update NEWS
Fixed bug #66827 Session raises E_NOTICE when session name variable is array
implemented copy libs of core exts in phpize mode
fix copy the ext dll into the prefix path in phpize mode
fix default prefix in phpize mode
fix file with zero size usage in phpize mode
Conflicts:
Zend/zend_opcode.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
ext/session/session.c
Diffstat (limited to 'ext/session/session.c')
-rw-r--r-- | ext/session/session.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index fdd6b1696a..ff04462ca4 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1405,9 +1405,16 @@ PHPAPI const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC) /* {{{ } /* }}} */ -#define PPID2SID \ - convert_to_string((ppid)); \ - PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0) +static void ppid2sid(zval *ppid TSRMLS_DC) { + if (Z_TYPE_P(ppid) != IS_STRING) { + PS(id) = NULL; + PS(send_cookie) = 1; + } else { + convert_to_string(ppid); + PS(id) = STR_INIT(Z_STRVAL_P(ppid), Z_STRLEN_P(ppid), 0); + PS(send_cookie) = 0; + } +} PHPAPI void php_session_reset_id(TSRMLS_D) /* {{{ */ { @@ -1502,9 +1509,8 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_P(data) == IS_ARRAY && (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess)) ) { - PPID2SID; + ppid2sid(ppid TSRMLS_CC); PS(apply_trans_sid) = 0; - PS(send_cookie) = 0; PS(define_sid) = 0; } @@ -1513,8 +1519,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_P(data) == IS_ARRAY && (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess)) ) { - PPID2SID; - PS(send_cookie) = 0; + ppid2sid(ppid TSRMLS_CC); } if (!PS(use_only_cookies) && !PS(id) && @@ -1522,8 +1527,7 @@ PHPAPI void php_session_start(TSRMLS_D) /* {{{ */ Z_TYPE_P(data) == IS_ARRAY && (ppid = zend_hash_str_find(Z_ARRVAL_P(data), PS(session_name), lensess)) ) { - PPID2SID; - PS(send_cookie) = 0; + ppid2sid(ppid TSRMLS_CC); } } |