From be51285dcafa0a4de0bd7716a44e05620ae5debe Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 9 Mar 2020 19:09:12 +0800 Subject: [PATCH] use '?random=jpg' to get an URL of a random file (3) --- function/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function/common.php b/function/common.php index 76497b4..35b7672 100644 --- a/function/common.php +++ b/function/common.php @@ -624,7 +624,7 @@ 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($tmp[rand(0,count($tmp)-1)],200); + if (count($tmp)>0) return output('', 302, [ 'Location' => $tmp[rand(0,count($tmp)-1)] ]); else return output('',404); } else return output('',401); }