mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Fix ParseConfig() handling of name-only options, thx @meandthemachine
This commit is contained in:
parent
f811d21dc7
commit
b7a6d334e3
@ -54,7 +54,7 @@ function cidr2mask($cidr)
|
||||
{
|
||||
$ipParts = explode('/', $cidr);
|
||||
$ip = $ipParts[0];
|
||||
$prefixLength = $ipParts[1];
|
||||
$prefixLength = $ipParts[1] ?? null;
|
||||
|
||||
$ipLong = ip2long($ip);
|
||||
$netmaskLong = bindec(str_pad(str_repeat('1', $prefixLength), 32, '0'));
|
||||
@ -458,6 +458,9 @@ function ParseConfig($arrConfig, $wg = false)
|
||||
|
||||
if (strpos($line, "=") !== false) {
|
||||
list($option, $value) = array_map("trim", explode("=", $line, 2));
|
||||
} else {
|
||||
$option = $line;
|
||||
$value = "";
|
||||
}
|
||||
if (empty($config[$option])) {
|
||||
$config[$option] = $value ?: true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user