From 22a4cc70c9aad4a97c5c4e1ee262c6d3a4533111 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 9 Nov 2020 18:05:02 +0800 Subject: [PATCH] fix: move to parentfolder --- common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common.php b/common.php index 319cf6c..62dd3ba 100644 --- a/common.php +++ b/common.php @@ -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);