From 29c133f11d3c0c4480c0accc60cc992115e3eb54 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Mon, 6 Mar 2000 14:36:11 +0000 Subject: (php_get_session_var) The variables are now serialized either from globals or from $HTTP_STATE_VARS[] array, depending on register_globals and track_vars settings. --- ext/session/session.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/session/session.c') diff --git a/ext/session/session.c b/ext/session/session.c index 0fe81c7e69..a27ae078de 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -158,7 +158,8 @@ typedef struct { char *key; \ ulong num_key; \ zval **struc; \ - ELS_FETCH() + ELS_FETCH(); \ + PLS_FETCH() #define ENCODE_LOOP(code) \ for (zend_hash_internal_pointer_reset(&PS(vars)); \ @@ -197,7 +198,12 @@ static void php_set_session_var(char *name, size_t namelen, static int php_get_session_var(char *name, size_t namelen, zval ***state_var PSLS_DC ELS_DC) { - return zend_hash_find(&EG(symbol_table), name, namelen + 1, (void **)state_var); + HashTable *ht = &EG(symbol_table); + + if (!PG(register_globals) && PG(track_vars)) + ht = PS(http_state_vars)->value.ht; + + return zend_hash_find(ht, name, namelen + 1, (void **)state_var); } PS_SERIALIZER_ENCODE_FUNC(php) -- cgit v1.2.1