From 716517abd4e9ea722ea40a8985c8078cf83b5fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Fri, 14 Jun 2024 17:57:37 +0200 Subject: [PATCH] fix: raise search page size limit for logged in users (#10444) logged in users can search up to 1000 results --- cgi/search.pl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cgi/search.pl b/cgi/search.pl index 7799734e20afe..b77a2eca6db00 100755 --- a/cgi/search.pl +++ b/cgi/search.pl @@ -228,10 +228,18 @@ } my $limit = 0 + (single_param('page_size') || $options{default_web_products_page_size}); -if ($limit > $options{max_products_page_size}) { + +if (defined $request_ref->{user_id}) { + if ($limit > $options{max_products_page_size_for_logged_in_users}) { + $limit = $options{max_products_page_size_for_logged_in_users}; + } +} +elsif ($limit > $options{max_products_page_size}) { $limit = $options{max_products_page_size}; } +$request_ref->{page_size} = $limit; + my $graph_ref = {graph_title => remove_tags_and_quote(decode utf8 => single_param("graph_title"))}; my $map_title = remove_tags_and_quote(decode utf8 => single_param("map_title"));