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

Commit a6fb84c

Browse files
michalbundyraweierophinney
authored andcommitted
Use strtr instead of str_replace
1 parent df5d0f5 commit a6fb84c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/functions/marshal_headers_from_sapi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ function marshalHeadersFromSapi(array $server) : array
4545
}
4646

4747
if (strpos($key, 'HTTP_') === 0) {
48-
$name = str_replace('_', '-', strtolower(substr($key, 5)));
48+
$name = strtr(strtolower(substr($key, 5)), '_', '-');
4949
$headers[$name] = $value;
5050
continue;
5151
}
5252

5353
if (strpos($key, 'CONTENT_') === 0) {
54-
$name = str_replace('_', '-', strtolower($key));
54+
$name = strtr(strtolower($key), '_', '-');
5555
$headers[$name] = $value;
5656
continue;
5757
}

0 commit comments

Comments
 (0)