Skip to content

Commit

Permalink
Don't assume port 0 for X-Forwarded-Port
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbowers committed Jun 19, 2019
1 parent eb4026b commit 23db9be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -1037,7 +1037,7 @@ public function getPort()
$pos = strrpos($host, ':');
}

if (false !== $pos) {
if (false !== $pos && !empty(substr($host, $pos + 1))) {
return (int) substr($host, $pos + 1);
}

Expand Down

0 comments on commit 23db9be

Please sign in to comment.