From 7e35b15ef231459ada0132eeae5cecfa9508ef09 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 25 Jan 2021 15:00:34 +0100 Subject: [PATCH] MonitoringRestrictions: Fix restriction validation --- .../Icingadb/Compat/MonitoringRestrictions.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/library/Icingadb/Compat/MonitoringRestrictions.php b/library/Icingadb/Compat/MonitoringRestrictions.php index a169ac8c..78e2232e 100644 --- a/library/Icingadb/Compat/MonitoringRestrictions.php +++ b/library/Icingadb/Compat/MonitoringRestrictions.php @@ -65,15 +65,17 @@ class MonitoringRestrictions } elseif ($column === $condition->getColumn()) { return; } - - throw new ConfigurationError( - t('Cannot apply restriction %s using the filter %s.' - . ' You can only use the following columns: %s'), - $name, - $queryString, - implode(', ', array_keys($allowedColumns)) - ); } + + throw new ConfigurationError( + t('Cannot apply restriction %s using the filter %s.' + . ' You can only use the following columns: %s'), + $name, + $queryString, + join(', ', array_map(function ($k, $v) { + return is_string($k) ? $k : $v; + }, array_keys($allowedColumns), $allowedColumns)) + ); })->parse()); }