|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-04-02 23:20 UTC] david at grudl dot com
Description:
------------
header_remove($name) removes only one header $name. The function header() behaves the same way and replaces only first header.
Test script:
---------------
header('A: first');
header('A: second', FALSE); // append
// removes only 'A: first' and header 'A: second' is sent
header_remove('A');
Expected result:
----------------
no 'A' header is sent
Actual result:
--------------
header A: second is sent
Patches0001-Fixed-bug-61605-header_remove-does-not-remove-all-headers (last revision 2012-04-03 17:44 UTC by reeze dot xia at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 22:00:02 2025 UTC |
Hi, after looking at the code,I found that SAPI it self did't handle multiple headers properly, apache2handler handles it for itself. so apache2handler can remove correctly. SAPI headers are saved in zend_llist. when try to remove or replace it simply try to find the first one it found. I've looked at sapi/cli&cgi they both didn't handle it itself. Sine header() doc says: "The optional replace parameter indicates whether the header should replace a previous similar header". but it did't behavior like this. So I made a patch for this. can someone review this pull request for me? https://github.com/php/php-src/pull/36 thanks.