mirror of
https://github.com/mivodev/mivo.git
synced 2026-01-26 05:25:42 +07:00
chore: bump version to v1.2.1
This commit is contained in:
@@ -97,10 +97,16 @@ class Router {
|
||||
|
||||
$path = parse_url($uri, PHP_URL_PATH);
|
||||
|
||||
// Handle subdirectory
|
||||
$scriptName = dirname($_SERVER['SCRIPT_NAME']);
|
||||
if (strpos($path, $scriptName) === 0) {
|
||||
$path = substr($path, strlen($scriptName));
|
||||
// Handle subdirectory (SKIP for PHP Built-in Server to avoid SCRIPT_NAME issues)
|
||||
if (php_sapi_name() !== 'cli-server') {
|
||||
$scriptName = dirname($_SERVER['SCRIPT_NAME']);
|
||||
// Normalize backslashes (Windows)
|
||||
$scriptName = str_replace('\\', '/', $scriptName);
|
||||
|
||||
// Ensure we don't strip root slash
|
||||
if ($scriptName !== '/' && strpos($path, $scriptName) === 0) {
|
||||
$path = substr($path, strlen($scriptName));
|
||||
}
|
||||
}
|
||||
$path = $this->normalizePath($path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user