From d9e07b3b2935e4a607da1816a2a0ca68a4898e70 Mon Sep 17 00:00:00 2001 From: mrgoldy Date: Sat, 2 May 2020 23:43:22 +0200 Subject: [PATCH] [ticket/16426] Ensure 0 is not added as an option PHPBB3-16426 --- phpBB/search.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index eba8338fec..edf6360caa 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1478,14 +1478,15 @@ if (!$s_forums) /** * Build options for a select list for the number of characters returned. * - * If the admin defined amount is not available, we add that option. + * If the admin defined amount is not within the predefined range, + * and the admin did not set it to unlimited (0), we add that option aswell. * * @deprecated 3.3.1-RC1 Templates should use an numeric input, in favor of a select. */ $s_characters = ''; $i_characters = array_merge([25, 50], range(100, 1000, 100)); -if (!in_array((int) $config['default_search_return_chars'], $i_characters)) +if ($config['default_search_return_chars'] && !in_array((int) $config['default_search_return_chars'], $i_characters)) { $i_characters[] = (int) $config['default_search_return_chars']; sort($i_characters);