gitweb: fix problem causing erroneous project list
The bug is manifest when running gitweb in a persistent process (e.g. FastCGI, PSGI), and it's easy to reproduce. If a gitweb request includes the searchtext parameter (i.e. s), subsequent requests using the project_list action--which is the default action--and without a searchtext parameter will be filtered by the searchtext value of the first request. This is because the value of the $search_regexp global (the value of which is based on the searchtext parameter) is currently being persisted between requests. Instead, clear $search_regexp before dispatching each request. Signed-off-by: Charles McGarvey <chazmcgarvey@brokenzipper.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Charles McGarvey committed
Jun 4, 2013 at 22:44 UTC
ca7a5dcfd39bdeb26d74074e78e6966df5e63a6b
1 file changed
+1
-1
gitweb/gitweb.perl
+1
-1
@@ -1086,7 +1086,7 @@ sub evaluate_and_validate_params {
1086
our $search_use_regexp = $input_params{'search_use_regexp'};
1087
1088
our $searchtext = $input_params{'searchtext'};
1089
- our $search_regexp;
1089
+ our $search_regexp = undef;
1090
if (defined $searchtext) {
1091
if (length($searchtext) < 2) {
1092
die_error(403, "At least two characters are required for search parameter");