mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
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 <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
76e4f5d025
commit
40375a83d2
|
@ -2213,12 +2213,18 @@ sub git_header_html {
|
|||
} 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',
|
||||
|
|
Loading…
Reference in a new issue