From 26bd632babfe2ed91df8f657fdfb05c37889f0b5 Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 16 Dec 2024 17:54:17 -0800 Subject: [PATCH] Resolve php warnings w/ null coalescing operator --- includes/dhcp.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/dhcp.php b/includes/dhcp.php index 4f89c13e..5a63b585 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -52,8 +52,8 @@ function DisplayDHCPConfig() $conf = ParseConfig($return); exec('cat '. RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return); $conf = array_merge(ParseConfig($return)); - $hosts = (array)$conf['dhcp-host']; - $upstreamServers = (array)$conf['server']; + $hosts = (array)($conf['dhcp-host'] ?? []); + $upstreamServers = (array)($conf['server'] ?? []); exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces); exec('cat ' . RASPI_DNSMASQ_LEASES, $leases);