fix: fix: fix: fix: FC base_path

This commit is contained in:
qkqpttgf 2020-09-23 15:04:30 +08:00 committed by GitHub
parent c25df135ad
commit a908ec285e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,11 @@ function GetPathSetting($event, $context)
$path = $event['path'];
$tmp = $event['requestURI'];
if (strpos($tmp, '?')) $tmp = substr($tmp, 0, strpos($tmp, '?'));
$_SERVER['base_path'] = substr($tmp, 0, -strlen($path)+1);
if ($path=='/'||$path=='') {
$_SERVER['base_path'] = $tmp;
} else {
$_SERVER['base_path'] = substr($tmp, 0, -strlen($path)+1);
}
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);