Bug #67131 [Ana->Csd]: setcookie() conditional for empty values not met
| From: | cmb@php.net | Date: | Mon, 24 Aug 2015 21:17:08 +0000 |
| Subject: | Bug #67131 [Ana->Csd]: setcookie() conditional for empty values not met | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195488@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67131&edit=1
ID: 67131
Updated by: cmb@php.net
Reported by: jpingel at bitpiston dot com
Summary: setcookie() conditional for empty values not met
-Status: Analyzed
+Status: Closed
Type: Bug
Package: HTTP related
Operating System: Ubuntu 14.04 x64
PHP Version: 5.5.11
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fc203fa37eb0454c94e7e30f3b4e5fc81b699699
Log: Fix #67131: setcookie() conditional for empty values not met
Previous Comments:
------------------------------------------------------------------------
[2015-08-24 20:58:24] cmb@php.net
Good catch! Thanks for the report and the analysis â and sorry for
the late reply.
A minor correction: the respective branch would be met, if an
empty string (or a value that is converted to an empty string,
such as NULL) is passed as $value parameter. So yes, obviously a
bug.
------------------------------------------------------------------------
[2014-04-25 05:11:55] jpingel at bitpiston dot com
Description:
------------
The conditional to check for an empty value when using setcookie() to work around old versions of
MSIE not deleting a cookie never seems to be met:
https://github.com/php/php-src/blob/php-5.5.11/ext/standard/head.c#L113
Currently the setcookie() tests pass as it appears that it was never taken into consideration on the
first test:
https://github.com/php/php-src/blob/php-5.5.11/ext/standard/tests/network/setcookie.phpt#L8
value && value_len == 0
this should probably be:
value == NULL || value_len == 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67131&edit=1