Fix Pico::evaluateRequestUrl(): PHP's built-in webserver doesn't always set QUERY_STRING

This commit is contained in:
Daniel Rudolf 2016-09-17 20:02:29 +02:00
parent f9f998af65
commit f73c9622b8
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -697,7 +697,7 @@ class Pico
protected function evaluateRequestUrl()
{
// use QUERY_STRING; e.g. /pico/?sub/page
$pathComponent = $_SERVER['QUERY_STRING'];
$pathComponent = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '';
if (!empty($pathComponent)) {
if (($pathComponentLength = strpos($pathComponent, '&')) !== false) {
$pathComponent = substr($pathComponent, 0, $pathComponentLength);