From a6fb84c5d881edee0e67cceb3a9afdf05e80ec84 Mon Sep 17 00:00:00 2001 From: webimpress Date: Tue, 8 Oct 2019 20:12:45 +0100 Subject: [PATCH] Use strtr instead of str_replace --- src/functions/marshal_headers_from_sapi.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions/marshal_headers_from_sapi.php b/src/functions/marshal_headers_from_sapi.php index d85706a8..dd01be4d 100644 --- a/src/functions/marshal_headers_from_sapi.php +++ b/src/functions/marshal_headers_from_sapi.php @@ -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; }