diff options
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/eventlog/inc/filterruleprocessor.inc.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules-available/eventlog/inc/filterruleprocessor.inc.php b/modules-available/eventlog/inc/filterruleprocessor.inc.php index 897f923d..29ad9c92 100644 --- a/modules-available/eventlog/inc/filterruleprocessor.inc.php +++ b/modules-available/eventlog/inc/filterruleprocessor.inc.php @@ -122,7 +122,7 @@ class FilterRuleProcessor } // Iterate over matches in $data - can be multiple if path contains '*' foreach ($items as $item) { - if (is_array($item)) + if ($item === null || is_array($item)) continue; $match = self::matches($item, $filter); if ($match === null) @@ -285,9 +285,12 @@ class FilterRuleProcessor private static function fillTemplate(string $template, array $values): string { - return preg_replace_callback('/%([0-9]+)\.([0-9]+|[a-z][a-z0-9]*)\.?([a-z]*)%/', function($m) use ($values) { + return preg_replace_callback('/%([0-9]+)(?::([0-9]+|[a-z][a-z0-9]*))?\.?([a-z]*)%/', function($m) use ($values) { if (!isset($values[$m[1]])) return '<invalid row index #' . $m[1] . '>'; + if (($m[2] ?? '') === '') { + $m[2] = 1; + } if (!isset($values[$m[1]][$m[2]])) return '<invalid column index #' . $m[2] . ' for row #' . $m[1] . '>'; $v = $values[$m[1]][$m[2]]; @@ -326,4 +329,4 @@ class FilterRuleProcessor return $a; } -}
\ No newline at end of file +} |