From:             [EMAIL PROTECTED]
Operating system: Win32 (XP)
PHP version:      4.1.1
PHP Bug Type:     Output Control
Bug description:  header() does not replace headers but always produces duplicates

>From the docs:
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 if you pass in FALSE as the second
argument you can force multiple headers of the same type.

At least with PHP 4.1.1/Win32(XP), this is NOT true - 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".
-- 
Edit bug report at http://bugs.php.net/?id=16458&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16458&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16458&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16458&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16458&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16458&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16458&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16458&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16458&r=submittedtwice

Reply via email to