diff --git a/src/www/status_dhcp_leases.php b/src/www/status_dhcp_leases.php index f555761ab..75e1ec66d 100644 --- a/src/www/status_dhcp_leases.php +++ b/src/www/status_dhcp_leases.php @@ -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']);