mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Merge pull request #1515 from RaspAP/fix/parse-dhcp
Update parsing of dhcp-range
This commit is contained in:
commit
804034a871
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue