Fix Pico's REQUEST_URI routing method when installed to /

This commit is contained in:
Daniel Rudolf 2017-07-18 21:31:14 +02:00
parent de74e7d867
commit 53e9eaa5e4
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -965,7 +965,8 @@ class Pico
// use REQUEST_URI (requires URL rewriting); e.g. /pico/sub/page
if (($this->requestUrl === null) && $this->isUrlRewritingEnabled()) {
$basePath = dirname($_SERVER['SCRIPT_NAME']) . '/';
$basePath = dirname($_SERVER['SCRIPT_NAME']);
$basePath = !in_array($basePath, array('.', '/')) ? $basePath . '/' : '/';
$basePathLength = strlen($basePath);
$requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';