Skip to content
Permalink
Browse files

RequestFactory: added workaround `[]` in REMOTE_ADDR [Closes #152]

  • Loading branch information...
dg committed Mar 9, 2019
1 parent 5c326b5 commit 5975c30153f839140cbf21aff393bb878358d3f4
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Http/RequestFactory.php
@@ -249,7 +249,7 @@ private function getMethod(): ?string
private function getClient(Url $url): array
{
$remoteAddr = !empty($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null;
$remoteAddr = !empty($_SERVER['REMOTE_ADDR']) ? trim($_SERVER['REMOTE_ADDR'], '[]') : null; // workaround for PHP 7.3
$remoteHost = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null;
// use real client address and host if trusted proxy is used

0 comments on commit 5975c30

Please sign in to comment.
You can’t perform that action at this time.