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(); }