From 16e11ad947d08de628034fa8fc0f05a74ca540dc Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 9 Dec 2006 13:14:06 +0000 Subject: [PATCH] MFB: Strip leading spaces from cookie names, that can come from multi-cookie headers where ; can be followed by any number of spaces. --- main/php_variables.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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'; } -- 2.50.1