Various small code improvements

pico-3.0-alpha
Daniel Rudolf 7 years ago
parent 24ab96ced9
commit 5e4d758acb
No known key found for this signature in database
GPG Key ID: A061F02CD8DE4538
  1. 8
      lib/Pico.php

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

Loading…
Cancel
Save