cvs: php4 /ext/session mod_files.c
| From: | Markus Fischer | Date: | Thu, 30 May 2002 11:41:37 +0000 |
| Subject: | cvs: php4 /ext/session mod_files.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12167@lists.php.net to get a copy of this message | ||
mfischer Thu May 30 07:41:37 2002 EDT
Modified files:
/php4/ext/session mod_files.c
Log:
- Tell the user why his session doesn't work if he uses custom session_id()s.
Index: php4/ext/session/mod_files.c
diff -u php4/ext/session/mod_files.c:1.74 php4/ext/session/mod_files.c:1.75
--- php4/ext/session/mod_files.c:1.74 Tue Apr 23 15:58:31 2002
+++ php4/ext/session/mod_files.c Thu May 30 07:41:37 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_files.c,v 1.74 2002/04/23 19:58:31 sas Exp $ */
+/* $Id: mod_files.c,v 1.75 2002/05/30 11:41:37 mfischer Exp $ */
#include "php.h"
@@ -58,6 +58,8 @@
PS_MOD(files)
};
+/* If you change the logic here, please also update the error message in
+ * ps_files_open() appropriately */
static int ps_files_valid_key(const char *key)
{
size_t len;
@@ -135,8 +137,11 @@
ps_files_close(data);
- if (!ps_files_valid_key(key) ||
- !ps_files_path_create(buf, sizeof(buf), data, key))
+ if (!ps_files_valid_key(key)) {
+ php_error(E_WARNING, "The session id contains illegal characters, valid characters are only
a-z, A-Z and 0-9");
+ return;
+ }
+ if (!ps_files_path_create(buf, sizeof(buf), data, key))
return;
data->lastkey = estrdup(key);