Skip to content

Commit

Permalink
Variable name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sergejey committed May 31, 2024
1 parent bf33e22 commit 324ae2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions load_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"];

Expand All @@ -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');
Expand Down
1 change: 1 addition & 0 deletions pChart/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
// Dataset definition
$DataSet = new pData;

$p = gr('p');
if (is_array($p)) {
$p = $p[0];
}
Expand Down

0 comments on commit 324ae2b

Please sign in to comment.