From faf883423e0e3bbda1515c57525c90f96a2f18bb Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Fri, 5 Jul 2024 06:30:53 -0700 Subject: [PATCH] Change some variable names in newsportal.php to make sense. --- Rocksolid_Light/rocksolid/newsportal.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index b62df98..ce609b0 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -2118,10 +2118,10 @@ function throttle_hits($client_device = null) // Block by user-agent if (isset($OVERRIDES['block_by_user_agent'])) { - $ua = strtolower($_SERVER["HTTP_USER_AGENT"]); - foreach ($OVERRIDES['block_by_user_agent'] as $user_agent) { - if (stripos($ua, $user_agent) !== false) { - file_put_contents($abuse_log, "\n" . format_log_date() . " [" . $_SERVER['REMOTE_ADDR'] . "] (blocking) '" . $user_agent . "' found in User-Agent block list", FILE_APPEND); + $this_ua = strtolower($_SERVER["HTTP_USER_AGENT"]); + foreach ($OVERRIDES['block_by_user_agent'] as $block_user_agent) { + if (stripos($this_ua, $block_user_agent) !== false) { + file_put_contents($abuse_log, "\n" . format_log_date() . " [" . $_SERVER['REMOTE_ADDR'] . "] (blocking) '" . $block_user_agent . "' found in User-Agent block list", FILE_APPEND); $_SESSION['throttled'] = true; header("HTTP/1.0 403 Forbidden"); exit(); @@ -2132,15 +2132,15 @@ function throttle_hits($client_device = null) if (isset($OVERRIDES['block_by_rdns'])) { $ip = $_SERVER['REMOTE_ADDR']; if (isset($rdns[$ip])) { - $ua = $rdns[$ip]; + $this_rdns = $rdns[$ip]; } else { - $ua = gethostbyaddr($ip); - $rdns[$ip] = $ua; + $this_rdns = gethostbyaddr($ip); + $rdns[$ip] = $this_rdns; file_put_contents($rdns_file, serialize($rdns)); } - foreach ($OVERRIDES['block_by_rdns'] as $user_agent) { - if (stripos($ua, $user_agent) !== false) { - file_put_contents($abuse_log, "\n" . format_log_date() . " [" . $_SERVER['REMOTE_ADDR'] . "] (blocking) '" . $user_agent . "' found in RDNS block list", FILE_APPEND); + foreach ($OVERRIDES['block_by_rdns'] as $block_rdns) { + if (stripos($this_rdns, $block_rdns) !== false) { + file_put_contents($abuse_log, "\n" . format_log_date() . " [" . $_SERVER['REMOTE_ADDR'] . "] (blocking) '" . $block_rdns . "' found in RDNS block list", FILE_APPEND); $_SESSION['throttled'] = true; header("HTTP/1.0 403 Forbidden"); exit();