From a5d3407cc77349f64efc36df93350e9e2e0d3270 Mon Sep 17 00:00:00 2001 From: Alexander Votteler Date: Tue, 7 Dec 2021 09:59:08 +0100 Subject: [PATCH] Fix problem wit RegEx match for multiple whitelist entries --- library/Director/IcingaConfig/IcingaConfigHelper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Director/IcingaConfig/IcingaConfigHelper.php b/library/Director/IcingaConfig/IcingaConfigHelper.php index 105e24ff5..26adb17a2 100644 --- a/library/Director/IcingaConfig/IcingaConfigHelper.php +++ b/library/Director/IcingaConfig/IcingaConfigHelper.php @@ -405,7 +405,9 @@ public static function renderStringWithVariables($string, array $whiteList = nul if ($whiteList !== null || $matchRegex) { foreach ($whiteList as $entry) { $pattern = "/^(" . $entry . "|" . $entry . "\..*)$/i"; - $whiteListMatch = preg_match($pattern, $macroName); + if (preg_match($pattern, $macroName)) { + $whiteListMatch = true; + } } // Otherwise simply match against array entries } elseif ($whiteList !== null) {