1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-20 04:31:23 +01:00

IP range bans for IPv6

This commit is contained in:
Savetheinternet 2011-03-31 03:05:45 +11:00
parent ee40b9b06c
commit b9354e2d35

View File

@ -213,7 +213,7 @@
$query->execute() or error(db_error($query));
if($config['ban_range']) {
$query = prepare("DELETE FROM `bans` WHERE :ip REGEXP CONCAT('^', REPLACE(REPLACE(`ip`, '.', '\\.'), '*', '[0-9]*'), '$') AND `expires` = :expires LIMIT 1");
$query = prepare("DELETE FROM `bans` WHERE :ip REGEXP CONCAT('^', REPLACE(REPLACE(`ip`, '.', '\\.'), '*', '[0-9a-f]*'), '$') AND `expires` = :expires LIMIT 1");
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
$query->bindValue(':expires', $ban['expires'], PDO::PARAM_INT);
$query->execute() or error(db_error($query));