Skip to content

Commit

Permalink
Code simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkusebauch committed May 22, 2016
1 parent 17d3397 commit a2c7a79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Http/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand Down

0 comments on commit a2c7a79

Please sign in to comment.