sas Sat Sep 21 01:46:32 2002 EDT
Modified files:
/php4/ext/session session.c
Log:
Because track vars are always initialized, get_session_var failed
to work in the register_globals=1 case.
It is now possible again to store session variables in global vars.
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.313 php4/ext/session/session.c:1.314
--- php4/ext/session/session.c:1.313 Thu Aug 15 15:32:08 2002
+++ php4/ext/session/session.c Sat Sep 21 01:46:32 2002
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.313 2002/08/15 19:32:08 kalowsky Exp $ */
+/* $Id: session.c,v 1.314 2002/09/21 05:46:32 sas Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -273,15 +273,24 @@
int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC)
{
+ /*
+ * If register_globals is set, the global variable is preferred.
+ *
+ * If it is not set and track vars are available, track vars are used.
+ */
+
+ if (PG(register_globals)) {
+ return zend_hash_find(&EG(symbol_table), 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 FAILURE;
}
- return zend_hash_find(&EG(symbol_table), name, namelen+1, (void **) state_var);
}
#define PS_BIN_NR_OF_BITS 8
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php