Merge branch 'qkqpttgf:master' into master

pull/610/head
gd1214b 2021-11-16 09:00:43 +08:00 committed by GitHub
commit deec49ae99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 29 additions and 34 deletions

View File

@ -256,6 +256,8 @@ function main($path)
// echo 'main.disktag:'.$_SERVER['disktag'].'path:'.$path.''; // echo 'main.disktag:'.$_SERVER['disktag'].'path:'.$path.'';
$_SERVER['list_path'] = getListpath($_SERVER['HTTP_HOST']); $_SERVER['list_path'] = getListpath($_SERVER['HTTP_HOST']);
if ($_SERVER['list_path']=='') $_SERVER['list_path'] = '/'; if ($_SERVER['list_path']=='') $_SERVER['list_path'] = '/';
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if ($path1!='/' && substr($path1,-1)=='/') $path1 = substr($path1, 0, -1);
$_SERVER['is_guestup_path'] = is_guestup_path($path); $_SERVER['is_guestup_path'] = is_guestup_path($path);
$_SERVER['ajax']=0; $_SERVER['ajax']=0;
if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') $_SERVER['ajax']=1; if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) if ($_SERVER['HTTP_X_REQUESTED_WITH']=='XMLHttpRequest') $_SERVER['ajax']=1;
@ -308,8 +310,6 @@ function main($path)
if (strpos($_GET['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400); if (strpos($_GET['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400);
if (strpos($_POST['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400); if (strpos($_POST['upbigfilename'], '../')!==false) return output('Not_Allow_Cross_Path', 400);
} }
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if (substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
return $drive->bigfileupload($path1); return $drive->bigfileupload($path1);
} }
} }
@ -317,8 +317,6 @@ function main($path)
if ($_SERVER['admin']) { if ($_SERVER['admin']) {
$tmp = adminoperate($path); $tmp = adminoperate($path);
if ($tmp['statusCode'] > 0) { if ($tmp['statusCode'] > 0) {
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if ($path1!='/'&&substr($path1,-1)=='/') $path1 = substr($path1, 0, -1);
savecache('path_' . $path1, '', $_SERVER['disktag'], 1); savecache('path_' . $path1, '', $_SERVER['disktag'], 1);
return $tmp; return $tmp;
} }
@ -329,8 +327,6 @@ function main($path)
if (isset($_GET['thumbnails'])) { if (isset($_GET['thumbnails'])) {
if ($_SERVER['ishidden']<4) { if ($_SERVER['ishidden']<4) {
if (in_array(strtolower(substr($path, strrpos($path, '.') + 1)), $exts['img'])) { if (in_array(strtolower(substr($path, strrpos($path, '.') + 1)), $exts['img'])) {
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if ($path1!='/'&&substr($path1, -1)=='/') $path1=substr($path1, 0, -1);
$thumb_url = $drive->get_thumbnails_url($path1); $thumb_url = $drive->get_thumbnails_url($path1);
if ($thumb_url!='') { if ($thumb_url!='') {
if ($_GET['location']) { if ($_GET['location']) {
@ -356,16 +352,22 @@ function main($path)
if (!getConfig('downloadencrypt', $_SERVER['disktag'])) { if (!getConfig('downloadencrypt', $_SERVER['disktag'])) {
$files = json_decode('{"type":"folder"}', true); $files = json_decode('{"type":"folder"}', true);
} else { } else {
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1, 0, -1);
$files = $drive->list_files($path1); $files = $drive->list_files($path1);
if ($files['type']=='folder') $files = json_decode('{"type":"folder"}', true); if ($files['type']=='folder') $files = json_decode('{"type":"folder"}', true);
} }
} else { } else {
$path1 = path_format($_SERVER['list_path'] . path_format($path));
if ($path1!='/'&&substr($path1,-1)=='/') $path1=substr($path1, 0, -1);
$files = $drive->list_files($path1); $files = $drive->list_files($path1);
} }
if ($path!=='') if ( $files['type']=='folder' && substr($path, -1)!=='/' ) {
$tmp = path_format($_SERVER['base_disk_path'] . $path . '/');
return output('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>308 Permanent Redirect</title>
</head><body>
<h1>Permanent Redirect</h1>
<p>The document has moved <a href="' . $tmp . '">here</a>.</p>
</body></html>', 308, [ 'Location' => $tmp ]);
}
if ($_GET['json']) { if ($_GET['json']) {
// return a json // return a json
@ -2394,6 +2396,7 @@ function render_list($path = '', $files = [])
$html = str_replace('<!--IsFolderEnd-->', '', $html); $html = str_replace('<!--IsFolderEnd-->', '', $html);
} }
$html = str_replace('<!--constStr@File-->', getconstStr('File'), $html); $html = str_replace('<!--constStr@File-->', getconstStr('File'), $html);
while (strpos($html, '<!--FolderId-->')) $html = str_replace('<!--FolderId-->', $files['id'], $html);
$html = str_replace('<!--constStr@ShowThumbnails-->', getconstStr('ShowThumbnails'), $html); $html = str_replace('<!--constStr@ShowThumbnails-->', getconstStr('ShowThumbnails'), $html);
$html = str_replace('<!--constStr@CopyAllDownloadUrl-->', getconstStr('CopyAllDownloadUrl'), $html); $html = str_replace('<!--constStr@CopyAllDownloadUrl-->', getconstStr('CopyAllDownloadUrl'), $html);
$html = str_replace('<!--constStr@EditTime-->', getconstStr('EditTime'), $html); $html = str_replace('<!--constStr@EditTime-->', getconstStr('EditTime'), $html);

View File

@ -194,8 +194,8 @@ class Aliyundrive {
$data['image_url_process'] = 'image/resize,w_1920/format,jpeg'; $data['image_url_process'] = 'image/resize,w_1920/format,jpeg';
$data['video_thumbnail_process'] = 'video/snapshot,t_0,f_jpg,w_300'; $data['video_thumbnail_process'] = 'video/snapshot,t_0,f_jpg,w_300';
$data['fields'] = '*'; $data['fields'] = '*';
$data['order_by'] = 'updated_at'; $data['order_by'] = 'name'; //updated_at
$data['order_direction'] = 'DESC'; $data['order_direction'] = 'ASC'; //DESC
$res = curl('POST', $url, json_encode($data), $header); $res = curl('POST', $url, json_encode($data), $header);
//error_log1($res['stat'] . $res['body']); //error_log1($res['stat'] . $res['body']);

View File

@ -49,6 +49,9 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') {
else echo $re['body']; else echo $re['body'];
} else { } else {
include 'platform/Normal.php'; include 'platform/Normal.php';
if (!function_exists('curl_init')) {
return message('<font color="red">Need curl</font>, please install php-curl.', 'Error', 500);
}
$path = getpath(); $path = getpath();
//echo 'path:'. $path; //echo 'path:'. $path;
$_GET = getGET(); $_GET = getGET();

View File

@ -54,9 +54,6 @@ function GetPathSetting($event, $context)
//$_SERVER['base_path'] = substr($tmp, 0, strlen(urldecode($event['path']))); //$_SERVER['base_path'] = substr($tmp, 0, strlen(urldecode($event['path'])));
} }
$_SERVER['base_path'] = spurlencode($_SERVER['base_path'], '/'); $_SERVER['base_path'] = spurlencode($_SERVER['base_path'], '/');
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['clientIP']; $_SERVER['REMOTE_ADDR'] = $event['clientIP'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With'][0]; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With'][0];

View File

@ -34,8 +34,6 @@ function GetPathSetting($event, $context)
$_SERVER['functionBrn'] = $context['functionBrn']; $_SERVER['functionBrn'] = $context['functionBrn'];
$_SERVER['base_path'] = '/'; $_SERVER['base_path'] = '/';
$path = $event['path']; $path = $event['path'];
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['X-Requested-With'];

View File

@ -57,8 +57,6 @@ function GetPathSetting($event, $context)
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path)); $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path));
if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/'; if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/';
} }
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip']; $_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with'];

View File

@ -57,8 +57,6 @@ function GetPathSetting($event, $context)
$_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path)); $_SERVER['base_path'] = substr($_SERVER['base_path'], 0, -strlen($path));
if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/'; if ($_SERVER['base_path']=='') $_SERVER['base_path'] = '/';
} }
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip']; $_SERVER['REMOTE_ADDR'] = $event['headers']['x-real-ip'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with'];

View File

@ -278,8 +278,9 @@ language:<br>';
$title = getconstStr('SelectLanguage'); $title = getconstStr('SelectLanguage');
return message($html, $title, 201); return message($html, $title, 201);
} }
$html .= '<a href="?install0">'.getconstStr('ClickInstall').'</a>, '.getconstStr('LogintoBind');
$title = 'Install'; $title = 'Install';
$html = '<a href="?install0">' . getconstStr('ClickInstall') . '</a>, ' . getconstStr('LogintoBind');
return message($html, $title, 201); return message($html, $title, 201);
} }

View File

@ -41,8 +41,6 @@ function GetPathSetting($event, $context)
$_SERVER['base_path'] = $event['requestContext']['path']; $_SERVER['base_path'] = $event['requestContext']['path'];
$path = substr($event['path'], strlen($event['requestContext']['path'])); $path = substr($event['path'], strlen($event['requestContext']['path']));
} }
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with'];

View File

@ -41,8 +41,6 @@ function GetPathSetting($event, $context)
$_SERVER['base_path'] = $event['requestContext']['path']; $_SERVER['base_path'] = $event['requestContext']['path'];
$path = substr($event['path'], strlen($event['requestContext']['path'])); $path = substr($event['path'], strlen($event['requestContext']['path']));
} }
if (substr($path,-1)=='/') $path=substr($path,0,-1);
$_SERVER['is_guestup_path'] = is_guestup_path($path);
//$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path); //$_SERVER['PHP_SELF'] = path_format($_SERVER['base_path'] . $path);
$_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp']; $_SERVER['REMOTE_ADDR'] = $event['requestContext']['sourceIp'];
$_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with']; $_SERVER['HTTP_X_REQUESTED_WITH'] = $event['headers']['x-requested-with'];

View File

@ -2,7 +2,7 @@
# NOTICE: # NOTICE:
The release is used as archive. The Releases is used as archive, not newest code.
Please read the descriptions of settings before raising an issue. Please read the descriptions of settings before raising an issue.

View File

@ -2,7 +2,7 @@
# 注意: # 注意:
release只是当存档用的 Releases只是当存档在用的并不是最新代码
请将设置中所有的设置项的说明都读一遍,有些问题就不用问了。 请将设置中所有的设置项的说明都读一遍,有些问题就不用问了。
@ -132,7 +132,7 @@
1. 新建函数 -- HTTP函数 1. 新建函数 -- HTTP函数
2. 运行环境选择php7.2 2. 运行环境选择php7.2
3. 触发器认证方式选择anonymous请求方式里面点一下GET再点一下POST最终框框里面有这2个 3. 触发器认证方式选择anonymous请求方式里面点一下GET再点一下POST最终框框里面有这2个
4. 上传代码 4. 上传代码这里的ZIP文件不能直接用从Github上下载的ZIP文件要将它解压后去掉外层文件夹后再压缩为ZIP。
5. 触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。 5. 触发器中点进去,找到配置自定义域名,点击前往,创建,路径中填 /* ,其它下拉选择。
6. 访问你的域名,开始安装 6. 访问你的域名,开始安装

View File

@ -229,7 +229,7 @@
<table class="list-table" id="list-table"> <table class="list-table" id="list-table">
<tr id="tr0"> <tr id="tr0">
<th class="file"> <th class="file">
<a onclick="sortby('a');"><!--constStr@File--></a> <a id="file_a0" fileid="<!--FolderId-->" onclick="sortby('a');"><!--constStr@File--></a>
<!--ShowThumbnailsStart--> <!--ShowThumbnailsStart-->
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<label><input type="checkbox" id="originalpic"><!--constStr@OriginalPic--></label> <label><input type="checkbox" id="originalpic"><!--constStr@OriginalPic--></label>
@ -1477,17 +1477,18 @@
document.getElementById('mask').style.display=''; document.getElementById('mask').style.display='';
//document.getElementById('mask').style.width=document.documentElement.scrollWidth+'px'; //document.getElementById('mask').style.width=document.documentElement.scrollWidth+'px';
document.getElementById('mask').style.height=document.documentElement.scrollHeight<window.innerHeight?window.innerHeight:document.documentElement.scrollHeight+'px'; document.getElementById('mask').style.height=document.documentElement.scrollHeight<window.innerHeight?window.innerHeight:document.documentElement.scrollHeight+'px';
var str;
if (num=='') { if (num=='') {
var str=''; str = '';
var fileid=''; num = 0;
} else { } else {
var str=decodeURIComponent(document.getElementById('file_a'+num).href); str = decodeURIComponent(document.getElementById('file_a'+num).href);
if (str.substr(-1)==' ') str=str.substr(0, str.length-1); if (str.substr(-1)==' ') str=str.substr(0, str.length-1);
if (str.substr(-1)=='/') str=str.substr(0, str.length-1); if (str.substr(-1)=='/') str=str.substr(0, str.length-1);
if (str.substr(-8)=='?preview') str=str.substr(0, str.length-8); if (str.substr(-8)=='?preview') str=str.substr(0, str.length-8);
if (str.lastIndexOf('/')>-1) str=str.substr(str.lastIndexOf('/')+1); if (str.lastIndexOf('/')>-1) str=str.substr(str.lastIndexOf('/')+1);
var fileid=document.getElementById('file_a'+num).attributes['fileid'].nodeValue;
} }
var fileid = document.getElementById('file_a'+num).attributes['fileid'].nodeValue;
document.getElementById(action + '_div').style.display=''; document.getElementById(action + '_div').style.display='';
document.getElementById(action + '_label').innerText=str;//.replace(/&/,'&amp;'); document.getElementById(action + '_label').innerText=str;//.replace(/&/,'&amp;');
document.getElementById(action + '_sid').value=num; document.getElementById(action + '_sid').value=num;