mirror of
https://github.com/php/php-src.git
synced 2025-08-20 01:14:28 +02:00
MFB: Strip leading spaces from cookie names, that can come from multi-cookie
headers where ; can be followed by any number of spaces.
This commit is contained in:
parent
fb2db6e6b1
commit
16e11ad947
1 changed files with 11 additions and 0 deletions
|
@ -504,6 +504,17 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
|
|||
int var_len;
|
||||
|
||||
val = strchr(var, '=');
|
||||
|
||||
if (arg == PARSE_COOKIE) {
|
||||
/* Remove leading spaces from cookie names, needed for multi-cookie header where ; can be followed by a space */
|
||||
while (isspace(*var)) {
|
||||
var++;
|
||||
}
|
||||
if (var == val || *var == '\0') {
|
||||
goto next_cookie;
|
||||
}
|
||||
}
|
||||
|
||||
if (val) {
|
||||
*val++ = '\0';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue