diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index b4133076..9fa30592 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -27,6 +27,9 @@ master (will be 1.6.0) * FEATURE: It's now possible to dump data as fetched by an Import Source (#1626) * FIX: Director Health Check no longer warns about no Imports/Syncs/Jobs (#1607) +### Icinga Configuration +* FIX: rendering of disabled objects containing `*/` has been fixed (#1263) + ### Icinga Agent handling * FEATURE: Ship latest PowerShell module (#1632 ) diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index 0ee80d2a..54484060 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -2468,7 +2468,8 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer if ($this->isDisabled()) { return "/* --- This object has been disabled ---\n" - . $str . "*/\n"; + // Do not allow strings to break our comment + . str_replace('*/', "* /", $str) . "*/\n"; } else { return $str; } diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php index 78cde10c..077f013a 100644 --- a/library/Director/Objects/IcingaService.php +++ b/library/Director/Objects/IcingaService.php @@ -405,7 +405,9 @@ class IcingaService extends IcingaObject implements ExportInterface && $this->get('host_id') && $this->getRelated('host')->isDisabled() ) { - return "/* --- This services host has been disabled ---\n$str*/\n"; + return "/* --- This services host has been disabled ---\n" + // Do not allow strings to break our comment + . str_replace('*/', "* /", $str) . "*/\n"; } else { return $str; }