From ee20bf574ae61b28119d9db1823777d35b07b9b2 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 11 Aug 2024 10:14:54 +0200 Subject: [PATCH] functions.php: format _create_antibot --- inc/functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index f1c2c26c..3530ab77 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1615,21 +1615,23 @@ function checkMute() { function _create_antibot($board, $thread) { global $config, $purged_old_antispam; - $antibot = new AntiBot(array($board, $thread)); + $antibot = new AntiBot([$board, $thread]); if (!isset($purged_old_antispam)) { $purged_old_antispam = true; query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); } - if ($thread) + if ($thread) { $query = prepare('UPDATE ``antispam`` SET `expires` = UNIX_TIMESTAMP() + :expires WHERE `board` = :board AND `thread` = :thread AND `expires` IS NULL'); - else + } 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) + if ($thread) { $query->bindValue(':thread', $thread); + } $query->bindValue(':expires', $config['spam']['hidden_inputs_expire']); $query->execute() or error(db_error($query));