summaryrefslogtreecommitdiff
path: root/ext/session/mod_files.c
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2003-01-16 07:21:49 +0000
committerSascha Schumann <sas@php.net>2003-01-16 07:21:49 +0000
commitdb8b4c67629334da8daad5ce28d51f8f644ef113 (patch)
tree2a46ff4125183a9006da1480ced0c4cb8907e091 /ext/session/mod_files.c
parent4e53357e9bab7ac8a22218f283213f8a4bec7fbf (diff)
downloadphp-git-db8b4c67629334da8daad5ce28d51f8f644ef113.tar.gz
Add INI setting session.hash_bits_per_character which enables developers
to choose how session ids are represented, regardless of the hash algorithm.
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r--ext/session/mod_files.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c
index 011ec1f770..d760156dca 100644
--- a/ext/session/mod_files.c
+++ b/ext/session/mod_files.c
@@ -73,9 +73,11 @@ static int ps_files_valid_key(const char *key)
for (p = key; (c = *p); p++) {
/* valid characters are a..z,A..Z,0..9 */
- if (!((c >= 'a' && c <= 'z') ||
- (c >= 'A' && c <= 'Z') ||
- (c >= '0' && c <= '9'))) {
+ if (!((c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || (c >= '0' && c <= '9')
+ || c == ','
+ || c == '-')) {
ret = 0;
break;
}
@@ -142,7 +144,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
ps_files_close(data);
if (!ps_files_valid_key(key)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'");
return;
}
if (!ps_files_path_create(buf, sizeof(buf), data, key))