From 3f4eab57cd59f0ba34637041323184e501185b95 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Thu, 19 Mar 2020 15:08:02 +0800 Subject: [PATCH] in upload, not open new window, add copy button --- function/common.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/function/common.php b/function/common.php index 1430b79..cc5dc0a 100644 --- a/function/common.php +++ b/function/common.php @@ -608,7 +608,12 @@ function main($path) $data = '{"name":"' . $_GET['filemd5'] . $ext . '"}'; //echo $oldname .'
'. $data; $tmp = MSAPI('PATCH',$oldname,$data,$_SERVER['access_token']); - if ($tmp['stat']==409) MSAPI('DELETE',$oldname,'',$_SERVER['access_token'])['body']; + if ($tmp['stat']==409) { + MSAPI('DELETE',$oldname,'',$_SERVER['access_token']); + $tmpbody = json_decode($tmp['body'], true); + $tmpbody['name'] = $_GET['filemd5'] . $ext; + $tmp['body'] = json_encode($tmpbody); + } $path1 = path_format($_SERVER['list_path'] . path_format($path)); savecache('path_' . $path1, json_decode('{}',true), 1); return output($tmp['body'],$tmp['stat']);