summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-11-23 21:36:40 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-11-23 21:36:40 +1100
commitd1c2db4493c2b9ecfd597d3f8a8155aba25cee05 (patch)
treeb39e0f5a25d5c5e4ca54390d1d1b01c70b4d16e4 /inc
parent09accb53ceb5952b532a101187bbbf0d3b4dfb67 (diff)
Minor bug causing range bans to not get purged
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php
index c76f8a19..5d59c300 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -484,7 +484,7 @@
$query->bindValue(':board', $board);
$query->execute() or error(db_error($query));
if($query->rowCount() < 1 && $config['ban_range']) {
- $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `uri` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` WHERE (`board` IS NULL OR `uri` = :board) AND :ip REGEXP CONCAT('^', REPLACE(REPLACE(`ip`, '.', '\\.'), '*', '.*'), '$') ORDER BY `expires` IS NULL DESC, `expires` DESC LIMIT 1");
+ $query = prepare("SELECT `set`, `expires`, `reason`, `board`, `uri`, `bans`.`id` FROM `bans` LEFT JOIN `boards` ON `boards`.`id` = `board` WHERE (`board` IS NULL OR `uri` = :board) AND :ip REGEXP CONCAT('^', REPLACE(REPLACE(`ip`, '.', '\\.'), '*', '.*'), '$') ORDER BY `expires` IS NULL DESC, `expires` DESC LIMIT 1");
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->bindValue(':board', $board);
$query->execute() or error(db_error($query));