diff --git a/mod.php b/mod.php index 011eea76..b8063dc9 100644 --- a/mod.php +++ b/mod.php @@ -1432,16 +1432,16 @@ if($mod['type'] < $config['mod']['unban']) error($config['error']['noaccess']); foreach($_POST as $post => $value) { - if(preg_match('/^ban_(.+)$/', $post, $m)) { - $m[1] = str_replace('_', '.', $m[1]); + if(preg_match('/^ban_(\w+)_(.+)$/', $post, $m)) { + $m[1] = str_replace('_', '.', $m[2]); $query = prepare("DELETE FROM `bans` WHERE `ip` = :ip"); - $query->bindValue(':ip', $m[1]); + $query->bindValue(':ip', $m[2]); $query->execute() or error(db_error($query)); if($config['memcached']['enabled']) { // Remove cached ban // TODO - $memcached->delete("ban_${m[1]}"); + $memcached->delete("ban_{$m[1]}_${m[2]}"); } } } @@ -1474,7 +1474,7 @@ '