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

Commit

Permalink
Use strtr instead of str_replace
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra authored and weierophinney committed Oct 8, 2019
1 parent df5d0f5 commit a6fb84c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions/marshal_headers_from_sapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ function marshalHeadersFromSapi(array $server) : array
}

if (strpos($key, 'HTTP_') === 0) {
$name = str_replace('_', '-', strtolower(substr($key, 5)));
$name = strtr(strtolower(substr($key, 5)), '_', '-');
$headers[$name] = $value;
continue;
}

if (strpos($key, 'CONTENT_') === 0) {
$name = str_replace('_', '-', strtolower($key));
$name = strtr(strtolower($key), '_', '-');
$headers[$name] = $value;
continue;
}
Expand Down

0 comments on commit a6fb84c

Please sign in to comment.