From: Matt McCutchen Date: Thu, 28 Jun 2007 18:57:07 +0000 (-0400) Subject: gitweb: make search form generate pathinfo-style URLs X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/2505a59c792d51f49d936814b33dd5bcb8ff1c4915fd1a173aca646a2d853e60 gitweb: make search form generate pathinfo-style URLs The search form generated traditional-style URLs with a "p=" parameter even when the pathinfo feature was on. This patch makes it generate pathinfo-style URLs when appropriate. Signed-off-by: Matt McCutchen Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index f0e775a..3ee147c 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -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) . "
\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',