projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
6fe020c
)
- rather use a list of disallowed chars
author
Michael Wallner
<mike@php.net>
Sat, 11 Feb 2006 14:33:31 +0000
(14:33 +0000)
committer
Michael Wallner
<mike@php.net>
Sat, 11 Feb 2006 14:33:31 +0000
(14:33 +0000)
- fix "foo\s+"
http_api.c
patch
|
blob
|
history
diff --git
a/http_api.c
b/http_api.c
index de1984a46fd6236edb4e4d014891426ea9ffc5c1..7762f20775de6a909721b4815c35163138867d29 100644
(file)
--- a/
http_api.c
+++ b/
http_api.c
@@
-185,32
+185,28
@@
PHP_HTTP_API STATUS _http_parse_cookie(const char *list, HashTable *items TSRMLS
case ST_KEY:
switch (*c)
{
case ST_KEY:
switch (*c)
{
- default:
- if (!isalnum(*c)) {
- goto failure;
- }
- case '.':
- case '_':
- case '$':
- case '@':
- if (!key) {
- key = c;
- }
+ case ',':
+ case '\r':
+ case '\n':
+ case '\t':
+ case '\013':
+ case '\014':
+ goto failure;
break;
break;
- case '
':
+ case '
=
':
if (key) {
keylen = c - key;
if (key) {
keylen = c - key;
- st = ST_ASSIGN;
+ st = ST_VALUE;
+ } else {
+ goto failure;
}
break;
}
break;
- case '
=
':
+ case '
':
if (key) {
keylen = c - key;
if (key) {
keylen = c - key;
- st = ST_VALUE;
- } else {
- goto failure;
+ st = ST_ASSIGN;
}
break;
}
break;
@@
-220,13
+216,19
@@
PHP_HTTP_API STATUS _http_parse_cookie(const char *list, HashTable *items TSRMLS
st = ST_ADD;
}
break;
st = ST_ADD;
}
break;
+
+ default:
+ if (!key) {
+ key = c;
+ }
+ break;
}
break;
case ST_ASSIGN:
if (*c == '=') {
st = ST_VALUE;
}
break;
case ST_ASSIGN:
if (*c == '=') {
st = ST_VALUE;
- } else if (*c == ';') {
+ } else if (
!*c ||
*c == ';') {
st = ST_ADD;
} else if (*c != ' ') {
goto failure;
st = ST_ADD;
} else if (*c != ' ') {
goto failure;