Skip to content

Commit

Permalink
Handle strange custom var names correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Jun 23, 2023
1 parent 95124aa commit 39ecc74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/Icingadb/Model/CustomvarFlat.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public function unFlattenVars(Traversable $flattenedVars): array
$step = array_shift($path);

$isIndex = (bool) preg_match('/^\[(\d+)]$/', $step, $m);
if ($isIndex) {
// Don't compute custom var names like `vars."[4]"` as array index access.
if (! isset($source[$step]) && $isIndex) {
$step = $m[1];
}

Expand Down

0 comments on commit 39ecc74

Please sign in to comment.