summaryrefslogtreecommitdiff
path: root/inc/bans.php
diff options
context:
space:
mode:
authorFredrick Brennan <admin@8chan.co>2014-09-20 15:20:00 +0000
committerFredrick Brennan <admin@8chan.co>2014-09-20 15:39:47 +0000
commit9070b061ee6c3ccd2ee8fa4988e57f63acc0f5fc (patch)
treefe0e7354980ce772b663bf63e57b1ab4d1ea6356 /inc/bans.php
parentea3c571d6c92af61540af32d15bf433cfc53879c (diff)
Bug fix: users were banned from /0/ if they had a ban anywhere else
Conflicts: inc/bans.php
Diffstat (limited to 'inc/bans.php')
-rw-r--r--inc/bans.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/inc/bans.php b/inc/bans.php
index d5225e95..c5132ef3 100644
--- a/inc/bans.php
+++ b/inc/bans.php
@@ -122,13 +122,13 @@ class Bans {
$query = prepare('SELECT ``bans``.*' . ($get_mod_info ? ', `username`' : '') . ' FROM ``bans``
' . ($get_mod_info ? 'LEFT JOIN ``mods`` ON ``mods``.`id` = `creator`' : '') . '
- WHERE
- (' . ($board ? '(`board` IS NULL OR `board` = :board) AND' : '') . '
- (`ipstart` = :ip OR (:ip >= `ipstart` AND :ip <= `ipend`)))
+ WHERE ' . ($id ? 'id = :id' : '
+ (' . ($board !== false ? '(`board` IS NULL OR `board` = :board) AND' : '') . '
+ (`ipstart` = :ip OR (:ip >= `ipstart` AND :ip <= `ipend`)))') . '
ORDER BY `expires` IS NULL, `expires` DESC');
- if ($board)
- $query->bindValue(':board', $board);
+ if ($board !== false)
+ $query->bindValue(':board', $board, PDO::PARAM_STR);
$query->bindValue(':ip', inet_pton($ip));
$query->execute() or error(db_error($query));