fixed IPAM config

Former-commit-id: 39b80d2ca41c21a823cdec5948e30109a81eeb2a
This commit is contained in:
Daniel Barbero Martin 2019-03-20 09:51:15 +01:00
parent c598eb60fb
commit 1fe1beb930
1 changed files with 10 additions and 7 deletions

View File

@ -81,11 +81,6 @@ function config_update_value($token, $value)
$value = ($value);
}
if (!isset($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value($token, io_safe_input($value));
}
// If it has not changed.
if ($config[$token] == $value) {
return true;
@ -100,10 +95,18 @@ function config_update_value($token, $value)
['token' => $token]
);
if ($result === 0) {
if ($result == 0) {
return true;
} else {
return (bool) $result;
if (!isset($config[$token])) {
$config[$token] = $value;
return (bool) config_create_value(
$token,
io_safe_input($value)
);
} else {
return (bool) $result;
}
}
}