diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-07-11 17:31:23 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-07-11 17:31:23 +0000 |
commit | 0e6168557b421f7b9a25cded9df6620ee781eb61 (patch) | |
tree | fffc71c16177ffebfbd975d3fe057f3e26442def /usr | |
parent | b6254ddb6c1cc9cfe4e41e64fb0d63ba2d40d7b8 (diff) | |
download | pfsense-0e6168557b421f7b9a25cded9df6620ee781eb61.zip pfsense-0e6168557b421f7b9a25cded9df6620ee781eb61.tar.gz |
Check for array and eliminate:
Warning: Invalid argument supplied for foreach()
in /usr/local/www/diag_dhcp_leases.php on line 232
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/diag_dhcp_leases.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/local/www/diag_dhcp_leases.php b/usr/local/www/diag_dhcp_leases.php index f2104e3..4a94a54 100755 --- a/usr/local/www/diag_dhcp_leases.php +++ b/usr/local/www/diag_dhcp_leases.php @@ -229,10 +229,12 @@ foreach ($leases as $data) { $lip = ip2long($data['ip']); if ($data['act'] == "static") { foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { - foreach ($dhcpifconf['staticmap'] as $staticent) { - if ($data['ip'] == $staticent['ipaddr']) { - $data['if'] = $dhcpif; - break; + if(is_array($dhcpifconf['staticmap'])) { + foreach ($dhcpifconf['staticmap'] as $staticent) { + if ($data['ip'] == $staticent['ipaddr']) { + $data['if'] = $dhcpif; + break; + } } } /* exit as soon as we have an interface */ |