Fix
This commit is contained in:
parent
fdce25fe98
commit
a403a65a69
@ -183,11 +183,11 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string
|
|||||||
if (!$onlyMine && !isModerator()) {
|
if (!$onlyMine && !isModerator()) {
|
||||||
$onlyMine = true;
|
$onlyMine = true;
|
||||||
}
|
}
|
||||||
$query = 'SELECT ID, Path FROM Files WHERE ID = ?' . ($onlyMine ? ' AND UploadedBy = ?' : '');
|
|
||||||
$stmtfileexists = $mysqli->prepare($query);
|
|
||||||
if ($onlyMine) {
|
if ($onlyMine) {
|
||||||
|
$stmtfileexists = $mysqli->prepare('SELECT ID, Path FROM Files WHERE ID = ? AND UploadedBy = ?');
|
||||||
$stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);
|
$stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);
|
||||||
} else {
|
} else {
|
||||||
|
$stmtfileexists = $mysqli->prepare('SELECT ID, Path FROM Files WHERE ID = ?');
|
||||||
$stmtfileexists->bind_param('i', $fileId);
|
$stmtfileexists->bind_param('i', $fileId);
|
||||||
}
|
}
|
||||||
$filePath = "";
|
$filePath = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user