From b9a0581119345b13f3b13b4bc5f5a240e5f26229 Mon Sep 17 00:00:00 2001 From: Santeri Hurnanen Date: Wed, 21 Aug 2024 16:05:24 +0300 Subject: [PATCH] UHF-10424: Fix match statement in hdbt_preprocess_feed_icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Päätökset triggers hdbt_preprocess_feed_icon such that title is not in match statement. This throws an exception. --- hdbt.theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hdbt.theme b/hdbt.theme index 0999df36b..b95dc6822 100644 --- a/hdbt.theme +++ b/hdbt.theme @@ -475,9 +475,9 @@ function hdbt_preprocess_feed_icon(&$variables): void { return; } - $variables['title'] = match(strtolower($variables['title'])) { - 'news', 'nyheter', 'uutiset' => t('all news', [], ['context' => 'Feed icon altered title']) - }; + if (in_array(strtolower($variables['title']), ['news', 'nyheter', 'uutiset'])) { + $variables['title'] = t('all news', [], ['context' => 'Feed icon altered title']); + } } /**