10000 [HttpFoundation] improve perf of previous merge (refs #8882) · symfony/symfony@729ac7b · GitHub
[go: up one dir, main page]

Skip to content

Commit 729ac7b

Browse files
committed
[HttpFoundation] improve perf of previous merge (refs #8882)
1 parent 85eaec3 commit 729ac7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,8 @@ public function getPort()
888888
}
889889

890890
if ($host = $this->headers->get('HOST')) {
891-
if (preg_match('/:(\d+)$/', $host, $matches)) {
892-
return intval($matches[1]);
891+
if (false !== $pos = strrpos($host, ':')) {
892+
return intval(substr($host, $pos + 1));
893893
}
894894

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

0 commit comments

Comments
 (0)
0