From 2ab4ba54a404b6f49f3a9d765c00648942dcb598 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Sun, 19 Jan 2020 01:30:40 +0800 Subject: [PATCH] fix:can't upload --- function/scf.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/function/scf.php b/function/scf.php index aefc4bf..ab1c9a3 100644 --- a/function/scf.php +++ b/function/scf.php @@ -67,21 +67,7 @@ function GetPathSetting($event, $context) $_SERVER['is_guestup_path'] = is_guestup_path($path); $_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; - $_SERVER['ajax']=0; - if ($event['headers']['x-requested-with']=='XMLHttpRequest') { - $_SERVER['ajax']=1; - } -/* - $referer = $event['headers']['referer']; - $tmpurl = substr($referer,strpos($referer,'//')+2); - $refererhost = substr($tmpurl,0,strpos($tmpurl,'/')); - if ($refererhost==$host_name) { - // Guest only upload from this site. 仅游客上传用,referer不对就空值,无法上传 - $_SERVER['current_url'] = substr($referer,0,strpos($referer,'//')) . '//' . $host_name.$_SERVER['PHP_SELF']; - } else { - $_SERVER['current_url'] = ''; - } -*/ + $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; return $path; }