Skip to content

Commit

Permalink
gitweb: fix problem causing erroneous project list
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
chazmcgarvey authored and gitster committed Jun 7, 2013
1 parent edca415 commit ca7a5dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ sub evaluate_and_validate_params {
our $search_use_regexp = $input_params{'search_use_regexp'};

our $searchtext = $input_params{'searchtext'};
our $search_regexp;
our $search_regexp = undef;
if (defined $searchtext) {
if (length($searchtext) < 2) {
die_error(403, "At least two characters are required for search parameter");
Expand Down

0 comments on commit ca7a5dc

Please sign in to comment.