fix: fix: fix: fix: FC base_path

pull/128/head
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']; $path = $event['path'];
$tmp = $event['requestURI']; $tmp = $event['requestURI'];
if (strpos($tmp, '?')) $tmp = substr($tmp, 0, strpos($tmp, '?')); if (strpos($tmp, '?')) $tmp = substr($tmp, 0, strpos($tmp, '?'));
if ($path=='/'||$path=='') {
$_SERVER['base_path'] = $tmp;
} else {
$_SERVER['base_path'] = substr($tmp, 0, -strlen($path)+1); $_SERVER['base_path'] = substr($tmp, 0, -strlen($path)+1);
}
if (substr($path,-1)=='/') $path=substr($path,0,-1); if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path); $_SERVER['is_guestup_path'] = is_guestup_path($path);