forked from Adleraci/adlerka.top
MEME
This commit is contained in:
parent
d96f74096b
commit
fa5ae71cef
@ -183,7 +183,7 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string
|
|||||||
if (!$onlyMine && !isAdmin()) {
|
if (!$onlyMine && !isAdmin()) {
|
||||||
$onlyMine = true;
|
$onlyMine = true;
|
||||||
}
|
}
|
||||||
$query = $onlyMine ? 'SELECT Path FROM Files WHERE ID = ? AND UploadedBy = ?' : 'SELECT Path FROM Files WHERE ID = ?';
|
$query = $onlyMine ? 'SELECT ID, Path FROM Files WHERE ID = ? AND UploadedBy = ?' : 'SELECT Path FROM Files WHERE ID = ?';
|
||||||
$stmtfileexists = $mysqli->prepare($query);
|
$stmtfileexists = $mysqli->prepare($query);
|
||||||
if ($onlyMine) {
|
if ($onlyMine) {
|
||||||
$stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);
|
$stmtfileexists->bind_param('ii', $fileId, $_SESSION['id']);
|
||||||
@ -191,7 +191,8 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string
|
|||||||
$stmtfileexists->bind_param('i', $fileId);
|
$stmtfileexists->bind_param('i', $fileId);
|
||||||
}
|
}
|
||||||
$filePath = "";
|
$filePath = "";
|
||||||
$stmtfileexists->bind_result($filePath);
|
$id = 0;
|
||||||
|
$stmtfileexists->bind_result($id, $filePath);
|
||||||
$stmtfileexists->execute();
|
$stmtfileexists->execute();
|
||||||
if ($stmtfileexists->num_rows > 0){
|
if ($stmtfileexists->num_rows > 0){
|
||||||
return $filePath;
|
return $filePath;
|
||||||
|
Loading…
Reference in New Issue
Block a user