forked from leftypol/leftypol
bans.php: do not deserialize post that does not exist
This commit is contained in:
parent
386f9998e1
commit
88eb7d68a7
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||
$ret['post'] = json_decode($ret['post'], true);
|
||||
if ($ret['post']) {
|
||||
$ret['post'] = json_decode($ret['post'], true);
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue