[HttpFoundation] improve perf of previous merge (refs #8882)

This commit is contained in:
Fabien Potencier 2013-09-07 08:13:51 +02:00
parent 85eaec3eda
commit 729ac7b967
1 changed files with 2 additions and 2 deletions

View File

@ -888,8 +888,8 @@ class Request
}
if ($host = $this->headers->get('HOST')) {
if (preg_match('/:(\d+)$/', $host, $matches)) {
return intval($matches[1]);
if (false !== $pos = strrpos($host, ':')) {
return intval(substr($host, $pos + 1));
}
return 'https' === $this->getScheme() ? 443 : 80;