mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Fix php warnings w/ null coalescing operator for $_POST keys
This commit is contained in:
parent
168dd18679
commit
26c64d42e6
@ -280,10 +280,10 @@ function updateDnsmasqConfig($iface,$status)
|
|||||||
$config .='log-facility='.RASPI_DHCPCD_LOG.PHP_EOL;
|
$config .='log-facility='.RASPI_DHCPCD_LOG.PHP_EOL;
|
||||||
$config .='conf-dir=/etc/dnsmasq.d'.PHP_EOL;
|
$config .='conf-dir=/etc/dnsmasq.d'.PHP_EOL;
|
||||||
// handle log option
|
// handle log option
|
||||||
if ($_POST['log-dhcp'] == "1") {
|
if (($_POST['log-dhcp'] ?? '') == "1") {
|
||||||
$config .= "log-dhcp".PHP_EOL;
|
$config .= "log-dhcp".PHP_EOL;
|
||||||
}
|
}
|
||||||
if ($_POST['log-queries'] == "1") {
|
if (($_POST['log-queries'] ?? '') == "1") {
|
||||||
$config .= "log-queries".PHP_EOL;
|
$config .= "log-queries".PHP_EOL;
|
||||||
}
|
}
|
||||||
$config .= PHP_EOL;
|
$config .= PHP_EOL;
|
||||||
@ -317,12 +317,12 @@ function updateDHCPConfig($iface,$status)
|
|||||||
if ($_POST['Metric'] !== '') {
|
if ($_POST['Metric'] !== '') {
|
||||||
$cfg[] = 'metric '.$_POST['Metric'];
|
$cfg[] = 'metric '.$_POST['Metric'];
|
||||||
}
|
}
|
||||||
if ($_POST['Fallback'] == 1) {
|
if (($_POST['Fallback'] ?? 0) == 1) {
|
||||||
$cfg[] = 'profile static_'.$iface;
|
$cfg[] = 'profile static_'.$iface;
|
||||||
$cfg[] = 'fallback static_'.$iface;
|
$cfg[] = 'fallback static_'.$iface;
|
||||||
}
|
}
|
||||||
$cfg[] = $_POST['DefaultRoute'] == '1' ? 'gateway' : 'nogateway';
|
$cfg[] = ($_POST['DefaultRoute'] ?? '') == '1' ? 'gateway' : 'nogateway';
|
||||||
if (( substr($iface, 0, 2) === "wl") && $_POST['NoHookWPASupplicant'] == '1') {
|
if (substr($iface, 0, 2) === "wl" && ($_POST['NoHookWPASupplicant'] ?? '') == '1') {
|
||||||
$cfg[] = 'nohook wpa_supplicant';
|
$cfg[] = 'nohook wpa_supplicant';
|
||||||
}
|
}
|
||||||
$dhcp_cfg = file_get_contents(RASPI_DHCPCD_CONFIG);
|
$dhcp_cfg = file_get_contents(RASPI_DHCPCD_CONFIG);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user