Pico::evaluateRequestUrl(): Improve REQUEST_URI handling
Don't 404 "/index.php" requests
This commit is contained in:
parent
b73e197ccb
commit
8138212a27
1 changed files with 6 additions and 2 deletions
|
@ -972,8 +972,12 @@ class Pico
|
|||
$requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
||||
if ($requestUri && (substr($requestUri, 0, $basePathLength) === $basePath)) {
|
||||
$requestUri = substr($requestUri, $basePathLength);
|
||||
$requestUri = strstr($requestUri, '?', true) ?: $requestUri;
|
||||
$this->requestUrl = rtrim(rawurldecode($requestUri), '/');
|
||||
if ($requestUri && (($queryStringPos = strpos($requestUri, '?')) !== false)) {
|
||||
$requestUri = substr($requestUri, 0, $queryStringPos);
|
||||
}
|
||||
if ($requestUri && ($requestUri !== basename($_SERVER['SCRIPT_NAME']))) {
|
||||
$this->requestUrl = rtrim(rawurldecode($requestUri), '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue