anti-bot.php: permanent bans stay permanent on new bans being issued

This commit is contained in:
Zankaria 2024-07-09 19:59:15 +02:00
parent 106db9a7e7
commit 684a3cb852

View file

@ -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);