note 20506 added to function.header
| From: | ernest at vogelsinger dot at | Date: | Fri, 05 Apr 2002 18:34:10 +0000 |
| Subject: | note 20506 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-28671@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
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+20506
http://master.php.net/manage/user-notes.php?action=delete+20506
http://master.php.net/manage/user-notes.php?action=reject+20506