Bug #67131 [Opn->Ana]: setcookie() conditional for empty values not met

From: Date: Mon, 24 Aug 2015 20:58:26 +0000
Subject: Bug #67131 [Opn->Ana]: setcookie() conditional for empty values not met
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195487@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: Open +Status: Analyzed Type: Bug Package: HTTP related Operating System: Ubuntu 14.04 x64 PHP Version: 5.5.11 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#195487) next »