diff --git a/ajax/networking/get_netcfg.php b/ajax/networking/get_netcfg.php index 117952bb..24ee228a 100644 --- a/ajax/networking/get_netcfg.php +++ b/ajax/networking/get_netcfg.php @@ -11,7 +11,11 @@ if (isset($interface)) { $conf = ParseConfig($return); $dhcpdata['DHCPEnabled'] = empty($conf) ? false : true; - $arrRange = explode(",", $conf['dhcp-range'][0]); + if (is_string($conf['dhcp-range'])) { + $arrRange = explode(",", $conf['dhcp-range']); + } else { + $arrRange = explode(",", $conf['dhcp-range'][0]); + } $dhcpdata['RangeStart'] = $arrRange[0]; $dhcpdata['RangeEnd'] = $arrRange[1]; $dhcpdata['RangeMask'] = $arrRange[2]; @@ -55,6 +59,5 @@ if (isset($interface)) { $dhcpdata['FallbackEnabled'] = empty($fallback) ? false: true; $dhcpdata['DefaultRoute'] = $gateway[0] == "gateway"; $dhcpdata['NoHookWPASupplicant'] = $nohook_wpa_supplicant[0] == "nohook wpa_supplicant"; - echo json_encode($dhcpdata); }