note 20506 rejected from function.header by torben
| From: | torben@php.net | Date: | Thu, 13 Jun 2002 18:44:30 +0000 |
| Subject: | note 20506 rejected from function.header by torben | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-31825@lists.php.net to get a copy of this message | ||
header() does not replace headers but always produces duplicates
At least with PHP 4.1.1/Win32(XP), the "replace" parameter has no effect - headers are
always added up.
Using this little test:
<?php
header('X-Test-Header: Version 1');
header('X-Test-Header: Version 2');
?>
this output is created:
-------------------------------------
php headers.php
X-Powered-By: PHP/4.1.1
X-Test-Header: Version 1
X-Test-Header: Version 2
Content-type: text/html
-------------------------------------
According to the docs, only "Version 2" of the header should be sent. The results are
identical if you do not provide the "replace" parameter, or if you set it to true or
false.
This is a very annoying bug, and for my application I'd rate it "critical".
Tested with PHP 4.1.1/Apache 1.3.23/WinXP