]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: make search form generate pathinfo-style URLs
[Gitweb] / gitweb.perl
index f0e775a092a4e51c6c3f8ed9c492619d28e76adefd35fa806d6239605ac9daeb..3ee147c757409f3f700b4aa998c87af783f64423a66fd85d639708771240be6e 100755 (executable)
@@ -2214,12 +2214,18 @@ EOF
                } else {
                        $search_hash = "HEAD";
                }
+               my $action = $my_uri;
+               my ($use_pathinfo) = gitweb_check_feature('pathinfo');
+               if ($use_pathinfo) {
+                       $action .= "/$project";
+               } else {
+                       $cgi->param("p", $project);
+               }
                $cgi->param("a", "search");
                $cgi->param("h", $search_hash);
-               $cgi->param("p", $project);
-               print $cgi->startform(-method => "get", -action => $my_uri) .
+               print $cgi->startform(-method => "get", -action => $action) .
                      "<div class=\"search\">\n" .
-                     $cgi->hidden(-name => "p") . "\n" .
+                     (!$use_pathinfo && $cgi->hidden(-name => "p") . "\n") .
                      $cgi->hidden(-name => "a") . "\n" .
                      $cgi->hidden(-name => "h") . "\n" .
                      $cgi->popup_menu(-name => 'st', -default => 'commit',
This page took 0.475327 seconds and 4 git commands to generate.