Standardize logging of useragent and rdns blocklist logging in abuse.log.

This commit is contained in:
Retro_Guy 2024-06-27 09:19:03 -07:00
parent d87deebe80
commit a0bed95f5e
1 changed files with 2 additions and 2 deletions

View File

@ -2121,7 +2121,7 @@ function throttle_hits($client_device = null)
$ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
foreach ($OVERRIDES['block_by_user_agent'] as $user_agent) {
if (stripos($ua, $user_agent) !== false) {
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Blocking " . $_SERVER['REMOTE_ADDR'] . " '" . $user_agent . "' listed in block list", FILE_APPEND);
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Blocking " . $_SERVER['REMOTE_ADDR'] . " '" . $user_agent . "' found in User-Agent block list", FILE_APPEND);
$_SESSION['throttled'] = true;
header("HTTP/1.0 403 Forbidden");
exit();
@ -2140,7 +2140,7 @@ function throttle_hits($client_device = null)
}
foreach ($OVERRIDES['block_by_rdns'] as $user_agent) {
if (stripos($ua, $user_agent) !== false) {
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Found in rdns " . $ua . " ' listed in block list", FILE_APPEND);
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Blocking " . $_SERVER['REMOTE_ADDR'] . " '" . $user_agent . "' found in RDNS block list", FILE_APPEND);
$_SESSION['throttled'] = true;
header("HTTP/1.0 403 Forbidden");
exit();