Fixed post lookup exploding with non-existent ID, closes #122.
This commit is contained in:
parent
142165338e
commit
778d5bad0e
1 changed files with 2 additions and 2 deletions
|
@ -77,8 +77,8 @@ function forum_post_find(int $postId, int $userId): array
|
|||
$getPostInfo->bindValue('post_id', $postId);
|
||||
$getPostInfo->bindValue('perm_user_id_user', $userId);
|
||||
$getPostInfo->bindValue('perm_user_id_role', $userId);
|
||||
|
||||
return $getPostInfo->execute() ? $getPostInfo->fetch(PDO::FETCH_ASSOC) : [];
|
||||
$postInfo = $getPostInfo->execute() ? $getPostInfo->fetch(PDO::FETCH_ASSOC) : false;
|
||||
return $postInfo ? $postInfo : [];
|
||||
}
|
||||
|
||||
function forum_post_get(int $postId, bool $allowDeleted = false): array
|
||||
|
|
Loading…
Reference in a new issue