From d07c3104fe21ea87248876148a194059877806a4 Mon Sep 17 00:00:00 2001 From: Fascinated Date: Sun, 9 Apr 2023 19:25:01 +0100 Subject: [PATCH] rename some vars --- upload.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/upload.php b/upload.php index 66402c4..54d769e 100644 --- a/upload.php +++ b/upload.php @@ -6,7 +6,7 @@ header('Content-type:application/json;charset=utf-8'); // Set the content type t /** * Configuration */ -$tokens = array("set me"); // Your secret keys +$uploadSecrets = array("set me"); // Your secret keys $uploadDir = "./"; // The upload directory $useRandomFileNames = false; // Use random file names instead of the original file name $shouldConvertToWebp = true; // Should the script convert images to webp? @@ -17,10 +17,10 @@ $webpThreadhold = 1048576; // 1MB - The minimum file size for converting to webp /** * Check if the token is valid */ -function checkToken($token): bool +function checkSecret($token): bool { - global $tokens; - return isset($token) && in_array($token, $tokens); + global $uploadSecrets; + return isset($token) && in_array($token, $uploadSecrets); } /** @@ -60,7 +60,7 @@ try { $file = $_FILES['sharex']; // The uploaded file // Check if the token is valid - if (!checkToken($token)) { + if (!checkSecret($token)) { returnJson(array( 'status' => 'ERROR', 'url' => 'Invalid or missing upload secret',