mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
* Fix regression with header removing removing whole prefixes The header removal code looked for the colon for key-value at the wrong place, so it would overzealously remove headers. Tweak that condition, and make the alternative condition only active if it's set (with the remove prefix op case). Fixes GH-21018. * avoid reading past the actual length * Rename variable to be more clear
22 lines
321 B
PHP
22 lines
321 B
PHP
--TEST--
|
|
GH-21018 (header() removes headers with the same prefix)
|
|
--INI--
|
|
expose_php=On
|
|
--CGI--
|
|
--FILE--
|
|
<?php
|
|
header('a: 1');
|
|
header('a-test: 1');
|
|
header('a: 1');
|
|
var_dump(headers_list());
|
|
?>
|
|
--EXPECTF--
|
|
array(3) {
|
|
[0]=>
|
|
string(%d) "X-Powered-By: PHP/%s"
|
|
[1]=>
|
|
string(9) "a-test: 1"
|
|
[2]=>
|
|
string(4) "a: 1"
|
|
}
|