Date: 05/30/01
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: uw: "[phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: max
Date: Wed May 30 16:12:11 2001
Modified files:
php-lib/php/session/session4.inc
Log message:
Some sanity checks in register(), is_registered() and unregister()
Index: php-lib/php/session/session4.inc
diff -u php-lib/php/session/session4.inc:1.10 php-lib/php/session/session4.inc:1.11
--- php-lib/php/session/session4.inc:1.10 Wed May 30 15:15:12 2001
+++ php-lib/php/session/session4.inc Wed May 30 16:11:40 2001
@@ -6,8 +6,8 @@
*
* <email protected> 1998,1999 NetUSE AG, Boris Erdmann, Kristian Koehntopp
* 2000 Teodor Cimpoesu <teo <email protected>>
-* <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>
-* <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $
+* <email protected> Teodor Cimpoesu <teo <email protected>>, Ulf Wendel <uw <email protected>>, Maxim Derkachev <kot <email protected>
+* <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $
* <email protected> public
* <email protected> PHPLib
*/
@@ -17,7 +17,7 @@
/**
* Session name
*
- * <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $s
+ * <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $s
*/
var $classname = "Session";
@@ -95,7 +95,7 @@
/**
*
* <email protected> string
- * <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $
*/
var $fallback_mode;
@@ -207,7 +207,7 @@
/**
* <email protected> id()
- * <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $
* <email protected> public
*/
function get_id($sid = '') {
@@ -224,7 +224,15 @@
* <email protected> public
*/
function register ($var_names) {
- return session_register(explode (',', $var_names));
+ if (!is_array($var_names)) {
+
+ // spaces spoil everything
+ $var_names = trim($var_names);
+ return session_register( preg_split('/\s*,\s*/', $var_names) );
+
+ }
+
+ return session_register($var_names);
} // end func register
/**
@@ -235,6 +243,7 @@
* <email protected> public
*/
function is_registered ($var_name) {
+ $var_name = trim($var_name); // to be sure
return session_is_registered($var_name);
} // end func is_registered
@@ -251,7 +260,7 @@
$ok = true;
foreach (explode (',', $var_names) as $var_name) {
- $ok = $ok && session_unregister ($var_name);
+ $ok = $ok && session_unregister ( trim($var_name) );
}
return $ok;
@@ -267,7 +276,7 @@
* doesn't seem to do (looking @ the session.c:940)
* uw: yes we should keep it to remain the same interface, but deprec.
*
- * <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $
* <email protected> public
* <email protected> $HTTP_COOKIE_VARS
*/
@@ -309,7 +318,7 @@
* <email protected> string rewritten url with session id included
* <email protected> $trans_id_enabled
* <email protected> $HTTP_COOKIE_VARS
- * <email protected> $Id: session4.inc,v 1.10 2001/05/30 13:15:12 uw Exp $
+ * <email protected> $Id: session4.inc,v 1.11 2001/05/30 14:11:40 max Exp $
* <email protected> public
*/
function url($url) {
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>
- Next message: max: "[phplib-dev] cvs commit"
- Previous message: uw: "[phplib-dev] cvs commit"
- Next in thread: max: "[phplib-dev] cvs commit"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

