Skip to content

Commit

Permalink
Update Request.php
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbowers committed Jun 19, 2019
1 parent 23db9be commit c266d6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -1037,8 +1037,8 @@ public function getPort()
$pos = strrpos($host, ':');
}

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

return 'https' === $this->getScheme() ? 443 : 80;
Expand Down

0 comments on commit c266d6c

Please sign in to comment.