From bdd50bd97d8621b9d2aee4265b92c0e97eecc1f0 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 16 Aug 2023 09:34:29 +0200 Subject: [PATCH] IniWriter: Variable $dangling is always set, but can be empty --- library/Icinga/File/Ini/IniWriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/File/Ini/IniWriter.php b/library/Icinga/File/Ini/IniWriter.php index f00040e39..1f470b006 100644 --- a/library/Icinga/File/Ini/IniWriter.php +++ b/library/Icinga/File/Ini/IniWriter.php @@ -118,7 +118,7 @@ class IniWriter { $doc = new Document(); $dangling = $oldDoc->getCommentsDangling(); - if (isset($dangling)) { + if (! empty($dangling)) { $doc->setCommentsDangling($dangling); } foreach ($newconfig->toArray() as $section => $directives) {