Skip to content

Commit

Permalink
Fix problem wit RegEx match for multiple whitelist entries
Browse files Browse the repository at this point in the history
  • Loading branch information
v0tti committed May 13, 2022
1 parent 8c97160 commit a5d3407
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/Director/IcingaConfig/IcingaConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a5d3407

Please sign in to comment.