summaryrefslogtreecommitdiff
path: root/ext/standard/head.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2015-08-24 23:03:50 +0200
committerChristoph M. Becker <cmb@php.net>2015-08-24 23:03:50 +0200
commitfc203fa37eb0454c94e7e30f3b4e5fc81b699699 (patch)
tree151ba898bb888bacaeada5c8b5b320cc36257a99 /ext/standard/head.c
parent78b2b1d6f74705d7835bf34297c2c6c78b2d0601 (diff)
downloadphp-git-fc203fa37eb0454c94e7e30f3b4e5fc81b699699.tar.gz
Fix #67131: setcookie() conditional for empty values not met
PHP applies a workaround for old MSIE where setting an empty cookie value would not delete the cookie. This workaround is only triggered if an empty string (or a value that converts to an empty string) is actually given as $value parameter of setcookie. If the $value parameter is omitted, an empty cookie value is sent. This commit fixes the inconsistent behavior.
Diffstat (limited to 'ext/standard/head.c')
-rw-r--r--ext/standard/head.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/head.c b/ext/standard/head.c
index f66c60437b..56a48a0be3 100644
--- a/ext/standard/head.c
+++ b/ext/standard/head.c
@@ -110,7 +110,7 @@ PHPAPI int php_setcookie(char *name, int name_len, char *value, int value_len, t
cookie = emalloc(len + 100);
- if (value && value_len == 0) {
+ if (value == NULL || value_len == 0) {
/*
* MSIE doesn't delete a cookie when you set it to a null value
* so in order to force cookies to be deleted, even on MSIE, we