diff options
author | Markus Fischer <mfischer@php.net> | 2002-05-30 11:41:37 +0000 |
---|---|---|
committer | Markus Fischer <mfischer@php.net> | 2002-05-30 11:41:37 +0000 |
commit | 39f16dbc65024329f5fad4db5cee3300e2c23edd (patch) | |
tree | 44cde41589a8cf840766350154733de4dc4f5a70 /ext/session/mod_files.c | |
parent | 82cc9a9404106e853e37e779781f86fb74f610fc (diff) | |
download | php-git-39f16dbc65024329f5fad4db5cee3300e2c23edd.tar.gz |
- Tell the user why his session doesn't work if he uses custom session_id()s.
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r-- | ext/session/mod_files.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index fca2df393e..95db098095 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -58,6 +58,8 @@ ps_module ps_mod_files = { 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 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC) 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); |