iliaa Sat Dec 9 13:14:06 2006 UTC
Modified files:
/php-src/main php_variables.c
Log:
MFB: Strip leading spaces from cookie names, that can come from multi-cookie
headers where ; can be followed by any number of spaces.
http://cvs.php.net/viewvc.cgi/php-src/main/php_variables.c?r1=1.132&r2=1.133&diff_format=u
Index: php-src/main/php_variables.c
diff -u php-src/main/php_variables.c:1.132 php-src/main/php_variables.c:1.133
--- php-src/main/php_variables.c:1.132 Sat Oct 21 10:01:39 2006
+++ php-src/main/php_variables.c Sat Dec 9 13:14:06 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_variables.c,v 1.132 2006/10/21 10:01:39 johannes Exp $ */
+/* $Id: php_variables.c,v 1.133 2006/12/09 13:14:06 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -504,6 +504,17 @@
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';
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php