cvs: php4 /ext/session session.c

From: Date: Sat, 24 Nov 2001 02:14:46 +0000
Subject: cvs: php4 /ext/session session.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8298@lists.php.net to get a copy of this message
zeev Fri Nov 23 21:14:46 2001 EDT Modified files: /php4/ext/session session.c Log: Entries registered with session_register() and altered by changing $_SESSION (or $HTTP_SESSION_VARS) were not properly saved. Fixed. Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.262 php4/ext/session/session.c:1.263 --- php4/ext/session/session.c:1.262 Fri Nov 23 20:08:05 2001 +++ php4/ext/session/session.c Fri Nov 23 21:14:45 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.262 2001/11/24 01:08:05 zeev Exp $ */ +/* $Id: session.c,v 1.263 2001/11/24 02:14:45 zeev Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -261,7 +261,6 @@ void php_set_session_var(char *name, size_t namelen, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC) { - if (PG(register_globals)) { zval **old_symbol; if (zend_hash_find(&EG(symbol_table),name,namelen+1,(void *)&old_symbol) == SUCCESS) { @@ -295,14 +294,15 @@ int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC) { - HashTable *ht = &EG(symbol_table); - - if (!PG(register_globals)) - ht = PS(http_session_vars) ? Z_ARRVAL_P(PS(http_session_vars)) : NULL; - - if (!ht) return HASH_KEY_NON_EXISTANT; - - return zend_hash_find(ht, name, namelen + 1, (void **)state_var); + if (PS(http_session_vars)) { + if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, (void **) state_var)==SUCCESS) { + return SUCCESS; + } + } else if (!PG(register_globals)) { + /* register_globals is disabled, but we don't have http_session_vars */ + return HASH_KEY_NON_EXISTANT; + } + return zend_hash_find(&EG(symbol_table), name, namelen+1, (void **) state_var); } #define PS_BIN_NR_OF_BITS 8

« previous php.cvs (#8298) next »