1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Fix php8 uncaught fatal error: ($value) must be of type Countable

This commit is contained in:
billz 2023-06-03 18:47:53 +00:00
parent e3a9919af1
commit 5c9e842244

View File

@ -187,6 +187,7 @@ function updateDnsmasqConfig($iface,$status)
} }
// Static leases // Static leases
$staticLeases = array(); $staticLeases = array();
if (isset($_POST["static_leases"]["mac"])) {
for ($i=0; $i < count($_POST["static_leases"]["mac"]); $i++) { for ($i=0; $i < count($_POST["static_leases"]["mac"]); $i++) {
$mac = trim($_POST["static_leases"]["mac"][$i]); $mac = trim($_POST["static_leases"]["mac"][$i]);
$ip = trim($_POST["static_leases"]["ip"][$i]); $ip = trim($_POST["static_leases"]["ip"][$i]);
@ -195,6 +196,7 @@ function updateDnsmasqConfig($iface,$status)
$staticLeases[] = array('mac' => $mac, 'ip' => $ip, 'comment' => $comment); $staticLeases[] = array('mac' => $mac, 'ip' => $ip, 'comment' => $comment);
} }
} }
}
// Sort ascending by IPs // Sort ascending by IPs
usort($staticLeases, "compareIPs"); usort($staticLeases, "compareIPs");
// Update config // Update config