Previous commit used an old cached copy of newsportal.php (thanks eclipse). This fixes that.

This commit is contained in:
Retro_Guy 2024-05-29 05:35:46 -07:00
parent 2ffdf5c4d2
commit cb9102d0d3
1 changed files with 2875 additions and 2875 deletions

View File

@ -2034,7 +2034,7 @@ function get_config_file_value($configfile, $request)
if ($configFileHandle = @fopen($configfile, 'r')) { if ($configFileHandle = @fopen($configfile, 'r')) {
while (! feof($configFileHandle)) { while (! feof($configFileHandle)) {
$buffer = fgets($configFileHandle); $buffer = fgets($configFileHandle);
if (strpos($buffer, $request . ':') !== 0) { if (strpos($buffer, $request . ':') !== FALSE) {
$dataline = $buffer; $dataline = $buffer;
fclose($configFileHandle); fclose($configFileHandle);
$datafound = explode(':', $dataline); $datafound = explode(':', $dataline);
@ -2056,7 +2056,7 @@ function get_config_value($configfile, $request)
if ($configFileHandle = @fopen($config_dir . '/' . $configfile, 'r')) { if ($configFileHandle = @fopen($config_dir . '/' . $configfile, 'r')) {
while (! feof($configFileHandle)) { while (! feof($configFileHandle)) {
$buffer = fgets($configFileHandle); $buffer = fgets($configFileHandle);
if (strpos($buffer, $request . ':') !== 0) { if (strpos($buffer, $request . ':') !== FALSE) {
$dataline = $buffer; $dataline = $buffer;
fclose($configFileHandle); fclose($configFileHandle);
$datafound = explode(':', $dataline); $datafound = explode(':', $dataline);
@ -2098,12 +2098,12 @@ function throttle_hits($client_device)
if (isset($OVERRIDES['block_by_user_agent'])) { if (isset($OVERRIDES['block_by_user_agent'])) {
$ua = strtolower($_SERVER["HTTP_USER_AGENT"]); $ua = strtolower($_SERVER["HTTP_USER_AGENT"]);
foreach ($OVERRIDES['block_by_user_agent'] as $user_agent) { foreach($OVERRIDES['block_by_user_agent'] as $user_agent) {
if (stripos($ua, $user_agent) !== false) { 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 . "' listed in block list", FILE_APPEND);
$_SESSION['throttled'] = true; $_SESSION['throttled'] = true;
header("HTTP/1.0 403 Forbidden"); header("HTTP/1.0 403 Forbidden");
exit(); exit;
} }
} }
} }
@ -2752,7 +2752,7 @@ function delete_message($messageid, $group = null, $overview_dbh = null)
/* Find section */ /* Find section */
$menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $menulist = file($config_dir . "menu.conf", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($grouplist as $group) { foreach ($grouplist as $group) {
if (! $config_name = get_section_by_group($groupname, true)) { if(!$config_name = get_section_by_group($groupname, true)) {
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Group not found: " . $group, FILE_APPEND); file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " Group not found: " . $group, FILE_APPEND);
continue; continue;
} }