IcingaObject: rendered disabled objects should...

...not break comments

fixes #1263
This commit is contained in:
Thomas Gelf 2018-10-30 19:39:44 +01:00
parent e8533b90a2
commit 6b4c47a649
3 changed files with 8 additions and 2 deletions

View File

@ -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 )

View File

@ -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;
}

View File

@ -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;
}