Update common.php

pull/31/head^2
qkqpttgf 2020-03-11 14:16:01 +08:00 committed by GitHub
parent 4630971e5c
commit a39089355a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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']) {