]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: fix problem causing erroneous project list
authorCharles McGarvey <redacted>
Wed, 5 Jun 2013 04:44:28 +0000 (22:44 -0600)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:32 +0000 (00:51 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 31713f8276a9c1490536ea66cd482814c6ad4e97e0f93504889e0a0f52983952..412ef1208433f5b6af8757940c667d14c7d4b6a0b074ac67d01c1e75ef819c3c 100755 (executable)
@@ -1087,7 +1087,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");
This page took 0.374907 seconds and 4 git commands to generate.