Proberly handle hostnames with ports in Pico::getBaseUrl()
(#472)
* fixed getting current port from current host Resolves #472
This commit is contained in:
parent
cbed65cfdf
commit
84949975b0
|
@ -2054,8 +2054,8 @@ class Pico
|
||||||
|
|
||||||
$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']') ?: 0) : strrpos($host, ':');
|
$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']') ?: 0) : strrpos($host, ':');
|
||||||
if ($hostPortPosition !== false) {
|
if ($hostPortPosition !== false) {
|
||||||
$host = substr($host, 0, $hostPortPosition);
|
|
||||||
$port = (int) substr($host, $hostPortPosition + 1);
|
$port = (int) substr($host, $hostPortPosition + 1);
|
||||||
|
$host = substr($host, 0, $hostPortPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
$protocol = 'http';
|
$protocol = 'http';
|
||||||
|
|
Loading…
Reference in a new issue