From a39089355aa17d1464407355adb60470395361b6 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 11 Mar 2020 14:16:01 +0800 Subject: [PATCH] Update common.php --- function/common.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/function/common.php b/function/common.php index 813eb83..393f994 100644 --- a/function/common.php +++ b/function/common.php @@ -624,8 +624,10 @@ function main($path) if (strtolower(splitlast($filename,'.')[1])==strtolower($_GET['random'])) $tmp[$filename] = $files['children'][$filename]['@microsoft.graph.downloadUrl']; } $tmp = array_values($tmp); - if (count($tmp)>0) return output('', 302, [ 'Location' => $tmp[rand(0,count($tmp)-1)] ]); - else return output('',404); + if (count($tmp)>0) { + if (isset($_GET['url'])) return output($tmp[rand(0,count($tmp)-1)], 200); + return output('', 302, [ 'Location' => $tmp[rand(0,count($tmp)-1)] ]); + } else return output('',404); } else return output('',401); } if (isset($files['file']) && !$_GET['preview']) {