This commit is contained in:
Bruno Rybársky 2024-04-25 23:27:04 +02:00
parent a507b507a5
commit 37982115ed

@ -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 = $onlyMine ? 'SELECT Path FROM Files WHERE ID = ? AND UploadedBy = ?' : 'SELECT Path FROM Files WHERE ID = ?';
$stmtfileexists = $mysqli->prepare($query);
if ($onlyMine) {
$stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);