From d6b80570533b9b47d07a75405db08c65a52ae7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 27 Apr 2024 11:57:07 +0200 Subject: [PATCH] Update meme voting --- lib/upload.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/upload.php b/lib/upload.php index 64ccafe..276ef30 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -106,7 +106,7 @@ function doImageUpload($inFile, $outFile): bool function listFiles($onlyMine = true): array { - $output = ["Status" => "Fail"]; + $output = ["Status" => "Success"]; require_once "lib/account.php"; if (isLoggedIn()) { global $mysqli; @@ -134,7 +134,7 @@ function listFiles($onlyMine = true): array $stmt->bind_result($id, $path, $type, $uploadedAt, $uploadedByID, $uploadedBy); $stmt->execute(); - + $files = array(); // Fetch the results into the bound variables while ($stmt->fetch()) { $files[] = [ @@ -148,10 +148,7 @@ function listFiles($onlyMine = true): array } // Check if any results were fetched - if (!empty($files)) { - $output["Status"] = "Success"; - $output["Files"] = $files; - } + $output["Files"] = $files; $stmt->close(); }