[PATCH] Suggested fix for #16458: header() does not replace headers but always produces duplicates

From: Date: Tue, 14 May 2002 20:32:45 +0000
Subject: [PATCH] Suggested fix for #16458: header() does not replace headers but always produces duplicates
Groups: php.dev 
Request: Send a blank email to php-dev+get-84067@lists.php.net to get a copy of this message
Bug #16458 reports that the header() command does not correctly use the replace parameter (i.e., a header of the same name should be replaced if this parameter is true). The problem is that the standard sapi_add_header_ex function assumes that the sapi being used with deal with any header replacements. For Apache that works fine as the Apache sapi correctly used the replace parameter. The IIS sapi, however, defaults to the standard funtionality in sapi_add_header_ex (as does the CGI). The default handler just calls zend_llist_add_element to add the header to the header list thus appending even if replace was requested. Attached is a suggested patch that first removes the header from the list if it already exists if we are in replace mode. This works for the Win32 IIS and CGI builds, but I don't have a way to test any possible interaction this might have with the other sapi modules (or under GCC). Michael Sisolak msisolak@yahoo.com __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com

« previous php.dev (#84067) next »