From 7d2e2b69d2b1df3e26f27f1ea9ff85977412e5a8 Mon Sep 17 00:00:00 2001 From: Fascinated Date: Fri, 7 Jul 2023 23:59:27 +0100 Subject: [PATCH] fix error in nginx logs --- upload.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upload.php b/upload.php index 53c4b0f..9ce8692 100644 --- a/upload.php +++ b/upload.php @@ -90,11 +90,11 @@ function logToNginx($message): void } try { - $secret = $_POST['secret']; // The secret key - $file = $_FILES['sharex']; // The uploaded file + $secret = isset($_POST['secret']) ? $_POST['secret'] : null; // The secret key + $file = isset($_FILES['sharex']) ? $_FILES['sharex'] : null; // The uploaded file // Page to show if someone visits the upload script - if (!$secret && !$file) { + if ($secret == null && $file == null) { returnJson(array( 'status' => 'OK', 'url' => 'Welcome to the ShareX PHP Uploader! v' . $SCRIPT_VERSION,