From 8028c1bd9a613247d670f57ebb0ec3850a9fd52a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Tue, 8 Jul 2025 21:09:02 +0200 Subject: [PATCH] context.php: handle the search.flag_filter configuration option --- inc/context.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/inc/context.php b/inc/context.php index f5123b64..78812121 100644 --- a/inc/context.php +++ b/inc/context.php @@ -72,12 +72,14 @@ function build_context(array $config): Context { }, SearchService::class => function($c) { $config = $c->get('config'); - if ($config['user_flag']) { - $flags = $config['user_flags']; - } elseif ($config['country_flags']) { - $flags = Flags::EMBEDDED_FLAGS; - } else { - $flags = null; + + $flags = null; + if ($config['search']['flag_filter']) { + if ($config['user_flag']) { + $flags = $config['user_flags']; + } elseif ($config['country_flags']) { + $flags = Flags::EMBEDDED_FLAGS; + } } $board_uris = $config['search']['boards'] ?? null;