From a403a65a698d857c487481bd2b941ba6dc9eb07b Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 26 Apr 2024 10:45:39 +0200 Subject: [PATCH] Fix --- lib/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/upload.php b/lib/upload.php index 03b080e..e5a7bf0 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -183,11 +183,11 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string if (!$onlyMine && !isModerator()) { $onlyMine = true; } - $query = 'SELECT ID, Path FROM Files WHERE ID = ?' . ($onlyMine ? ' AND UploadedBy = ?' : ''); - $stmtfileexists = $mysqli->prepare($query); if ($onlyMine) { + $stmtfileexists = $mysqli->prepare('SELECT ID, Path FROM Files WHERE ID = ? AND UploadedBy = ?'); $stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']); } else { + $stmtfileexists = $mysqli->prepare('SELECT ID, Path FROM Files WHERE ID = ?'); $stmtfileexists->bind_param('i', $fileId); } $filePath = "";