From 93b0bafc8e68e92645a262e48b4c7b2a8477a885 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 21 Mar 2024 16:05:02 +0100 Subject: [PATCH] UrlMigrator: Don't use all available options if none match --- library/Icingadb/Compat/UrlMigrator.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/library/Icingadb/Compat/UrlMigrator.php b/library/Icingadb/Compat/UrlMigrator.php index 47780bed7..bad83d4f2 100644 --- a/library/Icingadb/Compat/UrlMigrator.php +++ b/library/Icingadb/Compat/UrlMigrator.php @@ -234,9 +234,14 @@ protected function rewrite(Filter\Rule $filter, array $legacyColumns) case $exprRule === self::LOWER_EXPR: $filter->setValue(strtolower($filter->getValue())); break; - case is_array($exprRule) && isset($exprRule[$filter->getValue()]): - $filter->setValue($exprRule[$filter->getValue()]); - break; + case is_array($exprRule): + if (isset($exprRule[$filter->getValue()])) { + $filter->setValue($exprRule[$filter->getValue()]); + + break; + } + + return false; default: $filter->setValue($exprRule); }