[OPTIMISATION] No reason to str_replace twice.

This commit is contained in:
Simon Sessingø
2015-12-19 20:18:35 +01:00
parent df2545dd37
commit c37a7159d2

View File

@@ -34,7 +34,7 @@ class Request {
$headers = array();
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) === 'HTTP_') {
$headers[str_replace(' ', '-', strtolower(str_replace('_', ' ', substr($name, 5))))] = $value;
$headers[strtolower(str_replace('_', '-', substr($name, 5)))] = $value;
}
}
return $headers;