Fix
This commit is contained in:
parent
688a68042c
commit
72287e315d
@ -7,6 +7,7 @@ function addMeme(string $title, string $memeText, int $imageID): array
|
|||||||
{
|
{
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
$output = ["Status" => "Fail"];
|
$output = ["Status" => "Fail"];
|
||||||
|
$output["Permalink"] = "/" . fileExists($imageID, false);
|
||||||
if (isLoggedIn() && fileExists($imageID, false) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) {
|
if (isLoggedIn() && fileExists($imageID, false) && !empty($title) && !empty($memeText) && !empty($imageID) && $imageID > 0) {
|
||||||
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
|
$stmtMemeAdd = $mysqli->prepare('INSERT INTO Memes (AuthorID, Title, TextContent, FileID) VALUES (?, ?, ?, ?)');
|
||||||
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
$stmtMemeAdd->bind_param('issi', $_SESSION['ID'], htmlspecialchars($title), htmlspecialchars($memeText), $imageID);
|
||||||
|
@ -180,7 +180,7 @@ function fileExists(int $fileId, bool $onlyMine = true): bool|string
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
if (!$onlyMine && !isAdmin()) {
|
if (!$onlyMine && !isModerator()) {
|
||||||
$onlyMine = true;
|
$onlyMine = true;
|
||||||
}
|
}
|
||||||
$query = $onlyMine ? 'SELECT ID, Path FROM Files WHERE ID = ? AND UploadedBy = ?' : 'SELECT ID, Path FROM Files WHERE ID = ?';
|
$query = $onlyMine ? 'SELECT ID, Path FROM Files WHERE ID = ? AND UploadedBy = ?' : 'SELECT ID, Path FROM Files WHERE ID = ?';
|
||||||
|
Loading…
Reference in New Issue
Block a user