Skip to content

Commit

Permalink
Fix a few PHP 8 warnings
Browse files Browse the repository at this point in the history
Signed-off-by: RD WebDesign <[email protected]>
  • Loading branch information
rdwebdesign committed Mar 26, 2023
1 parent c67056d commit d13f2dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scripts/pi-hole/php/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ function getGateway()
if (array_key_exists('FTLnotrunning', $gateway)) {
$ret = array('ip' => -1);
} else {
$ret = array_combine(array('ip', 'iface'), explode(' ', $gateway[0]));
$ret = array_combine(array('ip', 'iface'), array_pad(explode(' ', $gateway[0]), 2, ''));
}

return $ret;
Expand Down
16 changes: 9 additions & 7 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,18 @@
}
} else {
$DHCP = false;
$DHCPstart = '';
$DHCPend = '';
$DHCProuter = '';

// Try to guess initial settings
if ($IPv4GW !== 'unknown') {
$DHCPparts = explode('.', $IPv4GW);
$DHCPstart = $DHCPparts[0].'.'.$DHCPparts[1].'.'.$DHCPparts[2].'.201';
$DHCPend = $DHCPparts[0].'.'.$DHCPparts[1].'.'.$DHCPparts[2].'.251';
$DHCProuter = $IPv4GW;
} else {
$DHCPstart = '';
$DHCPend = '';
$DHCProuter = '';
if (isset($DHCPparts[0]) && isset($DHCPparts[1]) && isset($DHCPparts[2])) {
$DHCPstart = $DHCPparts[0].'.'.$DHCPparts[1].'.'.$DHCPparts[2].'.201';
$DHCPend = $DHCPparts[0].'.'.$DHCPparts[1].'.'.$DHCPparts[2].'.251';
$DHCProuter = $IPv4GW;
}
}
$DHCPleasetime = 24;
$DHCPIPv6 = false;
Expand Down

0 comments on commit d13f2dc

Please sign in to comment.