diff --git a/lib/upload.php b/lib/upload.php index 56129e4..0365cde 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -184,7 +184,6 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string $onlyMine = true; } $query = 'SELECT Path FROM Files WHERE ID = ?' . ($onlyMine ? ' AND UploadedBy = ?' : ''); - echo $query; $stmtfileexists = $mysqli->prepare($query); if ($onlyMine) { $stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']); @@ -194,7 +193,7 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string $filePath = ""; $stmtfileexists->bind_result($filePath); $stmtfileexists->execute(); - if (!empty($filePath)){ + if ($stmtfileexists->num_rows > 0){ return $filePath; } else {