-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #76954: apache_response_headers removes last character from heade…
…r name
- Loading branch information
1 parent
c097acd
commit 47b89bc
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--TEST-- | ||
apache_response_headers() | ||
--SKIPIF-- | ||
<?php | ||
include "skipif.inc"; | ||
?> | ||
--FILE-- | ||
<?php | ||
include "include.inc"; | ||
|
||
$php = get_cgi_path(); | ||
reset_env_vars(); | ||
|
||
$test_file = dirname(__FILE__) . DIRECTORY_SEPARATOR ."apache_response_headers.test.php"; | ||
|
||
$code = '<?php'; | ||
$code .= ' | ||
header( "X-Robots-Tag : noindex,nofollow,noarchive" ); | ||
header( "Content-type: text/html; charset=UTF-8" ); | ||
header( "Bad-header" ); | ||
header( " : " ); | ||
header( ":" ); | ||
flush(); | ||
var_dump( apache_response_headers() ); | ||
?> | ||
'; | ||
|
||
file_put_contents( $test_file, $code ); | ||
|
||
passthru( "$php -n -q " . escapeshellarg( $test_file ) ); | ||
|
||
?> | ||
===DONE=== | ||
--CLEAN-- | ||
<?php | ||
@unlink( dirname(__FILE__) . DIRECTORY_SEPARATOR ."apache_response_headers.test.php" ); | ||
?> | ||
--EXPECTF-- | ||
array(3) { | ||
["X-Powered-By"]=> | ||
string(%d) "PHP/%s" | ||
["X-Robots-Tag"]=> | ||
string(26) "noindex,nofollow,noarchive" | ||
["Content-type"]=> | ||
string(24) "text/html; charset=UTF-8" | ||
} | ||
===DONE=== |