Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d67e256

Browse files
michalbundyraweierophinney
authored andcommitted
Ignore integer keys in the array
Fixes #369
1 parent 3a045fe commit d67e256

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/functions/marshal_headers_from_sapi.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Zend\Diactoros;
1111

1212
use function array_key_exists;
13+
use function is_string;
1314
use function strpos;
1415
use function strtolower;
1516
use function strtr;
@@ -23,6 +24,10 @@ function marshalHeadersFromSapi(array $server) : array
2324
{
2425
$headers = [];
2526
foreach ($server as $key => $value) {
27+
if (! is_string($key)) {
28+
continue;
29+
}
30+
2631
// Apache prefixes environment variables with REDIRECT_
2732
// if they are added by rewrite rules
2833
if (strpos($key, 'REDIRECT_') === 0) {

0 commit comments

Comments
 (0)