Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
v0tti committed May 13, 2022
1 parent b514048 commit 8c97160
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions library/Director/IcingaConfig/IcingaConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,13 @@ public static function renderStringWithVariables($string, array $whiteList = nul
$macroName = substr($string, $start + 1, $i - $start - 1);
if (static::isValidMacroName($macroName)) {
$whiteListMatch = false;
// If matchRegex, match macro with parameter
if ($whiteList !== null || $matchRegex) {
foreach ($whiteList as $entry) {
$pattern = "/^(" . $entry . "|" . $entry . "\..*)$/i";
$whiteListMatch = preg_match($pattern, $macroName);
}
// Otherwise simply match against array entries
} elseif ($whiteList !== null) {
$whiteListMatch = in_array($macroName, $whiteList);
}
Expand Down

0 comments on commit 8c97160

Please sign in to comment.