IcingaConfigHelper: always render $user.*$ and...

...$notification.*$ as macros

fixes #1176
This commit is contained in:
Thomas Gelf 2017-09-12 15:47:42 +02:00
parent bc8af635e8
commit 77290c3bf3
1 changed files with 11 additions and 0 deletions

View File

@ -318,6 +318,17 @@ class IcingaConfigHelper
static::renderString($string)
);
// TODO: this is an exemption for special variables. It would
// never make any sense to evaluate them at parse time.
// Another issue remains: there might be other reasons
// for "late evaluation". But how to distinguish those
// use cases?
$string = preg_replace(
'/" \+ ((?:user|notification)\.[\w\.]+) \+ "/',
'\$${1}\$',
$string
);
if (substr($string, 0, 5) === '"" + ') {
$string = substr($string, 5);
}