Skip to content

Commit 23db9be

Browse files
authored
Don't assume port 0 for X-Forwarded-Port
1 parent eb4026b commit 23db9be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpFoundation/Request.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ public function getPort()
10371037
$pos = strrpos($host, ':');
10381038
}
10391039

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

0 commit comments

Comments
 (0)