fix download encrypt file

pull/98/head
qkqpttgf 2020-03-04 11:50:01 +08:00 committed by GitHub
parent be2f353639
commit fcfc50d4b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -616,7 +616,7 @@ function main($path)
$files = list_files($path);
if (isset($files['file']) && !$_GET['preview']) {
// is file && not preview mode
if ( $_SERVER['ishidden']<4 || (getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) return output('', 302, [ 'Location' => $files['@microsoft.graph.downloadUrl'] ]);
if ( $_SERVER['ishidden']<4 || (!!getConfig('downloadencrypt')&&$files['name']!=getConfig('passfile')) ) return output('', 302, [ 'Location' => $files['@microsoft.graph.downloadUrl'] ]);
}
if ( isset($files['folder']) || isset($files['file']) ) {
return render_list($path, $files);
@ -633,6 +633,7 @@ function list_files($path)
$files = json_decode('{"folder":{}}', true);
} elseif (!getConfig('downloadencrypt')) {
if ($_SERVER['ishidden']==4) $files = json_decode('{"folder":{}}', true);
else $files = fetch_files($path);
} else {
$files = fetch_files($path);
}