diff --git a/src/opnsense/scripts/dhcp/cleanup_leases4.php b/src/opnsense/scripts/dhcp/cleanup_leases4.php index ef9c8bfc2..ed10d5548 100755 --- a/src/opnsense/scripts/dhcp/cleanup_leases4.php +++ b/src/opnsense/scripts/dhcp/cleanup_leases4.php @@ -55,8 +55,8 @@ if (isset($opts['m'])) { foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { if (!empty($dhcpifconf['staticmap']) && !empty($dhcpifconf['enable'])) { foreach ($dhcpifconf['staticmap'] as $static) { - if (!empty($static['mac'])) { - $addresses[$static['mac']] = !empty($static['ipaddr']) ? $static['ipaddr'] : ""; + if (!empty($static['mac']) && !empty($static['ipaddr'])) { + $addresses[$static['mac']] = $static['ipaddr']; } } }