fix:can't upload

pull/4/head
qkqpttgf 2020-01-19 01:30:40 +08:00 committed by GitHub
parent 5b726fbae2
commit 2ab4ba54a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 15 deletions

View File

@ -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;
}