summaryrefslogtreecommitdiff
path: root/inc/bans.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/bans.php')
-rw-r--r--inc/bans.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/bans.php b/inc/bans.php
index d5225e95..ed81c6e4 100644
--- a/inc/bans.php
+++ b/inc/bans.php
@@ -123,12 +123,12 @@ 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' : '') . '
+ (' . ($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));