From a908ec285e60ff3bc9f32c719f0797e173d56457 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 23 Sep 2020 15:04:30 +0800 Subject: [PATCH] fix: fix: fix: fix: FC base_path --- platform/AliyunFC.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/AliyunFC.php b/platform/AliyunFC.php index d7d21ba..6500b72 100644 --- a/platform/AliyunFC.php +++ b/platform/AliyunFC.php @@ -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);