Various small code improvements

This commit is contained in:
Daniel Rudolf 2018-12-03 11:51:39 +01:00
parent 24ab96ced9
commit 5e4d758acb
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -1094,6 +1094,10 @@ class Pico
}
}
}
if ($this->requestUrl === null) {
$this->requestUrl = '';
}
}
/**
@ -2048,7 +2052,7 @@ class Pico
$port = (int) $_SERVER['SERVER_PORT'];
}
$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']')) : strrpos($host, ':');
$hostPortPosition = ($host[0] === '[') ? strpos($host, ':', strrpos($host, ']') ?: 0) : strrpos($host, ':');
if ($hostPortPosition !== false) {
$host = substr($host, 0, $hostPortPosition);
$port = (int) substr($host, $hostPortPosition + 1);
@ -2136,6 +2140,8 @@ class Pico
if ($queryData) {
$queryData = ($this->isUrlRewritingEnabled() || !$page) ? '?' . $queryData : '&' . $queryData;
} else {
$queryData = '';
}
if (!$page) {