From a2c7a79b08e61390e754b6734aeee63fd3a84da2 Mon Sep 17 00:00:00 2001 From: Patrick Kusebauch Date: Sun, 22 May 2016 10:14:14 +0200 Subject: [PATCH] Code simplifications --- src/Http/RequestFactory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/RequestFactory.php b/src/Http/RequestFactory.php index cbaa9c88..b783c0f6 100644 --- a/src/Http/RequestFactory.php +++ b/src/Http/RequestFactory.php @@ -196,10 +196,10 @@ public function createHttpRequest() }); if ($usingTrustedProxy) { if(!empty($_SERVER['HTTP_FORWARDED'])) { - $forwardParams = preg_split('/[,]|[;]/', $_SERVER['HTTP_FORWARDED']); + $forwardParams = preg_split('/[,;]/', $_SERVER['HTTP_FORWARDED']); foreach ($forwardParams as $forwardParam) { - $param = explode("=", $forwardParam); - $proxyParams[strtolower(trim($param[0]))][] = trim($param[1], "\"\t\n\r\0\x0B"); //e.g. array['for'][0] = 192.168.0.1 + list($key, $value) = explode('=', $forwardParam, 2) + [1 => NULL]; + $proxyParams[strtolower(trim($key))][] = trim($value, " \t\""); } if(isset($proxyParams['for'])) {