From: Ilia Alshanetsky Date: Sat, 9 Dec 2006 13:14:06 +0000 (+0000) Subject: MFB: Strip leading spaces from cookie names, that can come from multi-cookie X-Git-Tag: RELEASE_1_0_0RC1~745 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16e11ad947d08de628034fa8fc0f05a74ca540dc;p=php MFB: Strip leading spaces from cookie names, that can come from multi-cookie headers where ; can be followed by any number of spaces. --- diff --git a/main/php_variables.c b/main/php_variables.c index 01da4741be..7c4f30f0ae 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -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'; }