From 1132955d4d227e86dda262a990d8d90669d3f63b Mon Sep 17 00:00:00 2001 From: Elias Werberich Date: Wed, 9 Aug 2017 18:26:22 +0200 Subject: [PATCH] src: Fix 'illegal offset' warnings --- src/www/status_dhcp_leases.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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']);