bans.php: do not deserialize post that does not exist

This commit is contained in:
Zankaria 2024-07-14 19:13:51 +02:00
parent 386f9998e1
commit 88eb7d68a7

View file

@ -72,7 +72,7 @@ class Bans {
static private function findSingleNoGc($ban_id) {
$query = prepare(
'SELECT ``bans``.* FROM ``bans``
WHERE ``bans``.id = :id
WHERE ``bans``.id = :id AND ip
ORDER BY `expires` IS NULL, `expires` DESC
LIMIT 1'
);
@ -84,7 +84,9 @@ class Bans {
if ($query->rowCount() == 0) {
return null;
} else {
if ($ret['post']) {
$ret['post'] = json_decode($ret['post'], true);
}
return $ret;
}
}