mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-12 16:34:25 +02:00
parent
c4e36ec467
commit
6aaff6b399
@ -130,13 +130,11 @@ class PreservingIniWriter extends Zend_Config_Writer_FileAbstract
|
|||||||
) {
|
) {
|
||||||
// The current section. This value is null when processing the section-less root element
|
// The current section. This value is null when processing the section-less root element
|
||||||
$section = empty($parents) ? null : $parents[0];
|
$section = empty($parents) ? null : $parents[0];
|
||||||
|
|
||||||
// Iterate over all properties in the new configuration file and search for changes
|
// Iterate over all properties in the new configuration file and search for changes
|
||||||
foreach ($newconfig as $key => $value) {
|
foreach ($newconfig as $key => $value) {
|
||||||
$oldvalue = $oldconfig->get($key);
|
$oldvalue = $oldconfig->get($key);
|
||||||
$nextParents = array_merge($parents, array($key));
|
$nextParents = array_merge($parents, array($key));
|
||||||
$keyIdentifier = empty($parents) ? array($key) : array_slice($nextParents, 1, null, true);
|
$keyIdentifier = empty($parents) ? array($key) : array_slice($nextParents, 1, null, true);
|
||||||
|
|
||||||
if ($value instanceof Zend_Config) {
|
if ($value instanceof Zend_Config) {
|
||||||
// The value is a nested Zend_Config, handle it recursively
|
// The value is a nested Zend_Config, handle it recursively
|
||||||
if ($section === null) {
|
if ($section === null) {
|
||||||
@ -194,6 +192,9 @@ class PreservingIniWriter extends Zend_Config_Writer_FileAbstract
|
|||||||
// The deleted value is a plain value, use the editor to delete it
|
// The deleted value is a plain value, use the editor to delete it
|
||||||
if (is_numeric($key)) {
|
if (is_numeric($key)) {
|
||||||
$editor->resetArrayElement($keyIdentifier, $section);
|
$editor->resetArrayElement($keyIdentifier, $section);
|
||||||
|
} elseif (!empty($parents)) {
|
||||||
|
// Drop nested properties, fixes #5958
|
||||||
|
$editor->resetArrayElement($nextParents, $section);
|
||||||
} else {
|
} else {
|
||||||
$editor->reset($keyIdentifier, $section);
|
$editor->reset($keyIdentifier, $section);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user