diff --git a/lib/upload.php b/lib/upload.php index 16950dd..3b0b1ce 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -183,7 +183,7 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string if (!$onlyMine && !isAdmin()) { $onlyMine = true; } - $query = 'SELECT Path FROM Files WHERE ID = ?' . $onlyMine ? ' AND UploadedBy = ?' : ''; + $query = 'SELECT Path FROM Files WHERE ID = ?' . ($onlyMine ? ' AND UploadedBy = ?' : ''); $stmtfileexists = $mysqli->prepare($query); if ($onlyMine) { $stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);