From 769f6b6e9554eb915aabd07444039eca364c1035 Mon Sep 17 00:00:00 2001 From: Kostiantyn Miakshyn Date: Mon, 14 Oct 2024 18:05:38 +0200 Subject: [PATCH 1/2] Fix: Fix Admin Settings page when selected tags to assign Watermark Signed-off-by: Kostiantyn Miakshyn --- lib/AppConfig.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/AppConfig.php b/lib/AppConfig.php index b2db4068ef..c980e9b581 100644 --- a/lib/AppConfig.php +++ b/lib/AppConfig.php @@ -54,6 +54,11 @@ class AppConfig { 'watermark_linkTagsList' => 'array' ]; + private const INTEGER_LIST_KEYS = [ + 'watermark_allTagsList' => true, + 'watermark_linkTagsList' => true, + ]; + public function __construct( private IConfig $config, private IAppManager $appManager, @@ -123,7 +128,11 @@ public function getAppSettings() { $value = $value === 'yes' ? true : $value; $result[$key] = $value === 'no' ? false : $value; } + if (!empty(self::INTEGER_LIST_KEYS[$key])) { + $result[$key] = array_map('intval', $result[$key] ?? []); + } } + return $result; } From 9f7742b7dd47fb37fca1ff3623250c731a01ec51 Mon Sep 17 00:00:00 2001 From: Elizabeth Danzberger Date: Tue, 15 Oct 2024 13:49:55 -0400 Subject: [PATCH 2/2] fix(psalm): fix logic Signed-off-by: Elizabeth Danzberger --- lib/AppConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AppConfig.php b/lib/AppConfig.php index c980e9b581..1c7046a7bc 100644 --- a/lib/AppConfig.php +++ b/lib/AppConfig.php @@ -128,7 +128,7 @@ public function getAppSettings() { $value = $value === 'yes' ? true : $value; $result[$key] = $value === 'no' ? false : $value; } - if (!empty(self::INTEGER_LIST_KEYS[$key])) { + if (array_key_exists($key, self::INTEGER_LIST_KEYS)) { $result[$key] = array_map('intval', $result[$key] ?? []); } }