fix: move to parentfolder

This commit is contained in:
qkqpttgf 2020-11-09 18:05:02 +08:00 committed by GitHub
parent c7a835d457
commit 22a4cc70c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1159,7 +1159,11 @@ function adminoperate($path)
if ($moveable) {
$filename = spurlencode($_GET['move_name']);
$filename = path_format($path1 . '/' . $filename);
$foldername = path_format('/'.urldecode($path1).'/'.$_GET['move_folder']);
if ($_GET['move_folder'] == '/../') {
$foldername = path_format('/' . urldecode($path1) . '/');
$foldername = substr($foldername, 0, -1);
$foldername = splitlast($foldername, '/')[0];
} else $foldername = path_format('/' . urldecode($path1) . '/' . $_GET['move_folder']);
$data = '{"parentReference":{"path": "/drive/root:'.$foldername.'"}}';
$result = MSAPI('PATCH', $filename, $data, $_SERVER['access_token']);
//savecache('path_' . $path1, json_decode('{}',true), $_SERVER['disktag'], 1);