diff options
| author | Savetheinternet <savetheinternet@tinyboard.org> | 2011-11-23 21:33:50 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@tinyboard.org> | 2011-11-23 21:33:50 +1100 |
| commit | 09accb53ceb5952b532a101187bbbf0d3b4dfb67 (patch) | |
| tree | 99654f46e67b5ec1593552340f92cbc94770cd32 /inc/functions.php | |
| parent | eca3ac079dacb78cce27b3f0c8f8ca6694ec8210 (diff) | |
"*" in range bans should match everything
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/functions.php b/inc/functions.php index ef3a7ef9..c76f8a19 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`, '.', '\\.'), '*', '[0-9]*'), '$') ORDER BY `expires` IS NULL DESC, `expires` DESC LIMIT 1"); + $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->bindValue(':ip', $_SERVER['REMOTE_ADDR']); $query->bindValue(':board', $board); $query->execute() or error(db_error($query)); |
