Update Request.php

This commit is contained in:
Alex Bowers 2019-06-19 17:03:11 +01:00 committed by GitHub
parent 23db9be884
commit c266d6c737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1037,8 +1037,8 @@ class Request
$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;