mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
validate fromArray in config class to ignore empty tags. If for some strange reason the frontend code drops empty tags, we need to ignore them.
Related to https://github.com/opnsense/core/issues/116
This commit is contained in:
parent
68212c0ccf
commit
cb9f82195f
@ -112,7 +112,7 @@ class Config extends Singleton
|
||||
// single content item
|
||||
if (is_array($forceList) && array_key_exists($xmlNode->getName(), $forceList)) {
|
||||
$result[$xmlNode->getName()] = array();
|
||||
if ($xmlNode->__toString() != null && trim($xmlNode->__toString()) !== "" ){
|
||||
if ($xmlNode->__toString() != null && trim($xmlNode->__toString()) !== "") {
|
||||
$result[$xmlNode->getName()][] = $xmlNode->__toString();
|
||||
}
|
||||
} else {
|
||||
@ -143,8 +143,9 @@ class Config extends Singleton
|
||||
}
|
||||
|
||||
foreach ($source as $itemKey => $itemValue) {
|
||||
if (is_bool($itemValue) && $itemValue == false) {
|
||||
// skip empty booleans
|
||||
if ((is_bool($itemValue) && $itemValue == false) || // skip empty booleans
|
||||
$itemKey == null || trim($itemKey) == "" // skip empty tag names
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (is_numeric($itemKey)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user