Proberly handle hostnames with ports in Pico::getBaseUrl() (#472)

* fixed getting current port from current host

Resolves #472
This commit is contained in:
M.Martellenghi 2018-12-17 13:09:44 +01:00 committed by Daniel Rudolf
parent cbed65cfdf
commit 84949975b0
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -2054,8 +2054,8 @@ class Pico
$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']') ?: 0) : strrpos($host, ':');
if ($hostPortPosition !== false) {
$host = substr($host, 0, $hostPortPosition);
$port = (int) substr($host, $hostPortPosition + 1);
$host = substr($host, 0, $hostPortPosition);
}
$protocol = 'http';