Merge pull request #1769 from wevcode/fix/dhcp-leases-php-warnings

Fix DHCP Leases PHP Illegal Offset Warnings
This commit is contained in:
Ad Schellevis 2017-08-09 22:42:39 +02:00 committed by GitHub
commit a1ddce48d6

View File

@ -48,17 +48,12 @@ function adjust_gmt($dt)
}
foreach ($dhcpd as $dhcpditem) {
$dhcpleaseinlocaltime = $dhcpditem['dhcpleaseinlocaltime'];
if ($dhcpleaseinlocaltime == "yes") {
break;
if (isset($dhcpditem['dhcpleaseinlocaltime']) && $dhcpleaseinlocaltime == "yes") {
$ts = strtotime($dt . " GMT");
return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
}
}
if ($dhcpleaseinlocaltime == "yes") {
$ts = strtotime($dt . " GMT");
return strftime("%Y/%m/%d %I:%M:%S%p", $ts);
}
return $dt;
}
@ -387,7 +382,7 @@ include("head.inc");?>
$lip = ip2ulong($data['ip']);
if ($data['act'] == "static") {
foreach ($dhcpd as $dhcpif => $dhcpifconf) {
if(is_array($dhcpifconf['staticmap'])) {
if(isset($dhcpifconf['staticmap']) && is_array($dhcpifconf['staticmap'])) {
foreach ($dhcpifconf['staticmap'] as $staticent) {
if ($data['ip'] == $staticent['ipaddr']) {
$data['int'] = htmlspecialchars($interfaces[$dhcpif]['descr']);