From c25df135ad870757a7c4520f739e3ef72b8f6375 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Tue, 22 Sep 2020 20:47:29 +0800 Subject: [PATCH] fix: fix: fix: FC base_path --- platform/AliyunFC.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/AliyunFC.php b/platform/AliyunFC.php index d50114a..d7d21ba 100644 --- a/platform/AliyunFC.php +++ b/platform/AliyunFC.php @@ -39,7 +39,9 @@ function GetPathSetting($event, $context) $_SERVER['service_name'] = $context['service']['name']; $_SERVER['function_name'] = $context['function']['name']; $path = $event['path']; - $_SERVER['base_path'] = substr($event['requestURI'], 0, -strlen($path)+1); + $tmp = $event['requestURI']; + if (strpos($tmp, '?')) $tmp = substr($tmp, 0, strpos($tmp, '?')); + $_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);