From 684a3cb852f1a2ea46a9f9a94e5a6508a54443e7 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Tue, 9 Jul 2024 19:59:15 +0200 Subject: [PATCH] anti-bot.php: permanent bans stay permanent on new bans being issued --- inc/anti-bot.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/inc/anti-bot.php b/inc/anti-bot.php index 90259e8d..15a2954e 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -191,7 +191,7 @@ class AntiBot { } function _create_antibot($board, $thread) { - global $config, $purged_old_antispam; + global $purged_old_antispam; $antibot = new AntiBot(array($board, $thread)); @@ -200,17 +200,6 @@ function _create_antibot($board, $thread) { query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); } - if ($thread) - $query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL'); - else - $query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` IS NULL AND `expires` IS NULL'); - - $query->bindValue(':board', $board); - if ($thread) - $query->bindValue(':thread', $thread); - $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); - $query->execute() or error(db_error($query)); - $query = prepare('INSERT INTO ``antispam`` VALUES (:board, :thread, :hash, UNIX_TIMESTAMP(), NULL, 0)'); $query->bindValue(':board', $board); $query->bindValue(':thread', $thread);