#45860 [Opn->Ver]: header() function fails to correctly replace all Status lines
| From: | jani@php.net | Date: | Wed, 20 Aug 2008 00:00:52 +0000 |
| Subject: | #45860 [Opn->Ver]: header() function fails to correctly replace all Status lines | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-128240@lists.php.net to get a copy of this message | ||
ID: 45860
Updated by: jani@php.net
Reported By: overlordq at gmail dot com
-Status: Open
+Status: Verified
Bug Type: CGI related
-Operating System: Linux x86_64
+Operating System: *
-PHP Version: 5.2.6
+PHP Version: 5.2CVS, 5.3CVS, 6CVS (2008-08-19)
Previous Comments:
------------------------------------------------------------------------
[2008-08-19 08:40:04] overlordq at gmail dot com
Description:
------------
From the documentation:
---
There are two special-case header calls. The first is a header that
starts with the string "HTTP/" (case is not significant), which will be
used to figure out the HTTP status code to send.
---
and
---
The optional replace parameter indicates whether the header should
replace a previous similar header, or add a second header of the same
type. By default it will replace [...]
---
But as can be seen below, header fails to replace headers in all cases.
Reproduce code:
---------------
http://toolserver.org/~overlordq/results.txt
Actual result:
--------------
As can be seen in the code linked above, header only truly replaces a
similar header in the case if the Status is 200, for every other status
code (that I've tested) PHP will output a duplicate header which does
not conform to CGI spec.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45860&edit=1