mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Fix issue that caused IniWriter to fail on empty configs
This commit is contained in:
parent
2a1f0132bc
commit
9b373e9d10
@ -67,6 +67,7 @@ class Document
|
|||||||
*/
|
*/
|
||||||
public function render()
|
public function render()
|
||||||
{
|
{
|
||||||
|
$sections = array();
|
||||||
foreach ($this->sections as $section) {
|
foreach ($this->sections as $section) {
|
||||||
$sections []= $section->render();
|
$sections []= $section->render();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ class Section
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*
|
*/
|
||||||
protected $name;
|
protected $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,8 +178,9 @@ class IniWriter
|
|||||||
Logger::warning('Section-less property ' . (string)$directives . ' was ignored.');
|
Logger::warning('Section-less property ' . (string)$directives . ' was ignored.');
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($newconfig->hasSection($section)) {
|
||||||
$newSection = $newconfig->getSection($section);
|
$newSection = $newconfig->getSection($section);
|
||||||
if (isset($newSection)) {
|
|
||||||
$oldDomSection = $doc->getSection($section);
|
$oldDomSection = $doc->getSection($section);
|
||||||
foreach ($directives as $key => $value) {
|
foreach ($directives as $key => $value) {
|
||||||
if ($value instanceof ConfigObject) {
|
if ($value instanceof ConfigObject) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user