From c266d6c7371799cf8d5f803322b24a773e5e1f1b Mon Sep 17 00:00:00 2001 From: Alex Bowers Date: Wed, 19 Jun 2019 17:03:11 +0100 Subject: [PATCH] Update Request.php --- src/Symfony/Component/HttpFoundation/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index fc26304ad2..38b7fc2169 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -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;