fix request count not resetting, added request graph (be3abbef16)
(1a4b91435a) (2305bd37f6) (bfebf441b8) (462c5e1729)
This commit is contained in:
FbIN Support 2026-09-06 18:01:22 +05:30
commit 3591fd879a

View file

@ -7,7 +7,6 @@ class bot_protection{
// check if we want captcha
if(config::BOT_PROTECTION !== 1){
apcu_inc("real_requests");
if($output === true){
$frontend->loadheader(
$get,
@ -32,7 +31,7 @@ class bot_protection{
// does key exist
apcu_exists($_COOKIE["pass"])
){
// exists, increment counter
$inc = apcu_inc($_COOKIE["pass"]);
@ -46,8 +45,6 @@ class bot_protection{
}else{
// the cookie is OK! dont die() and give results
apcu_inc("real_requests");
if($output === true){
$frontend->loadheader(
$get,
@ -132,8 +129,9 @@ class bot_protection{
$answers[] = $regex;
}
// dedup
$answers = array_unique($answers);
$answers = array_unique($answers);
if(
!$invalid &&
@ -163,8 +161,7 @@ class bot_protection{
$key = "k" . $inc . "." . $this->randomchars();
apcu_inc($key, 1, $stupid, 86400);
apcu_inc("real_requests");
apcu_dec(intdiv(time(), 3600) . ".bot_requests", 1, $s, 262800);
setcookie(
"pass",
@ -189,6 +186,7 @@ class bot_protection{
}
}
apcu_inc(intdiv(time(), 3600) . ".bot_requests", 1, $s, 259200);
$key = "c" . apcu_inc("captcha_gen", 1) . "." . $this->randomchars();
$payload = [
@ -251,7 +249,8 @@ class bot_protection{
$frontend->loadheader(
$get,
$filters,
$page
$page,
false
);
echo $frontend->load("search.html", $payload);