From 324ae2bb89fc64929b05ad9ae8fe33f3db91126f Mon Sep 17 00:00:00 2001 From: Sergei Jeihala Date: Fri, 31 May 2024 18:50:05 +0300 Subject: [PATCH] Variable name fix --- load_settings.php | 12 ++++++------ pChart/index.php | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/load_settings.php b/load_settings.php index 81228527f..0f5cdf7ad 100644 --- a/load_settings.php +++ b/load_settings.php @@ -147,11 +147,11 @@ function timezone_offset_string($offset) && !isset($argv[0]) && isset($_SERVER['REQUEST_URI']) ) { - $p = preg_quote($home_network); - $p = str_replace('\*', '\d+?', $p); - $p = str_replace(',', ' ', $p); - $p = str_replace(' ', ' ', $p); - $p = str_replace(' ', '|', $p); + $home_network_pattern = preg_quote($home_network); + $home_network_pattern = str_replace('\*', '\d+?', $home_network_pattern); + $home_network_pattern = str_replace(',', ' ', $home_network_pattern); + $home_network_pattern = str_replace(' ', ' ', $home_network_pattern); + $home_network_pattern = str_replace(' ', '|', $home_network_pattern); $remoteAddr = $_SERVER["REMOTE_ADDR"]; @@ -165,7 +165,7 @@ function timezone_offset_string($offset) $remoteAddr = getenv('HTTP_X_FORWARDED_FOR'); } - if (!preg_match('/' . $p . '/is', $remoteAddr) && $remoteAddr != $local_ip && trim($remoteAddr) != '::1') { + if (!preg_match('/' . $home_network_pattern . '/is', $remoteAddr) && $remoteAddr != $local_ip && trim($remoteAddr) != '::1') { if ($ext_access_username && $ext_access_password && $_SERVER['PHP_AUTH_USER'] == $ext_access_username && $_SERVER['PHP_AUTH_PW'] == $ext_access_password) { $data = $remoteAddr . " " . date("[d/m/Y:H:i:s]") . " Username and/or password valid. Login: " . $_SERVER['PHP_AUTH_USER'] . "\n"; DebMes($data, 'auth'); diff --git a/pChart/index.php b/pChart/index.php index 33a8961ce..74a797cb8 100644 --- a/pChart/index.php +++ b/pChart/index.php @@ -75,6 +75,7 @@ // Dataset definition $DataSet = new pData; +$p = gr('p'); if (is_array($p)) { $p = $p[0]; }