From bfca82f4e304c280a5bbdfd2455cc2fe883ead2a Mon Sep 17 00:00:00 2001 From: lolcat Date: Sat, 10 Oct 2026 17:22:49 -0400 Subject: [PATCH] fix bugs with bot request counter bleeeeeeerh --- lib/bot_protection.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/bot_protection.php b/lib/bot_protection.php index 51f711f..a1582d7 100644 --- a/lib/bot_protection.php +++ b/lib/bot_protection.php @@ -44,6 +44,8 @@ class bot_protection{ if($counter > config::RATELIMIT_BURST){ + apcu_inc(intdiv(time(), 3600) . ".bot_requests", 1, $s, 262800); + if($output === false){ http_response_code(429); @@ -259,7 +261,7 @@ class bot_protection{ } } - apcu_inc(intdiv(time(), 3600) . ".bot_requests", 1, $s, 259200); + apcu_inc(intdiv(time(), 3600) . ".bot_requests", 1, $s, 262800); $key = "c" . apcu_inc("captcha_gen", 1) . "." . $this->randomchars(); $payload = [