aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-12 22:43:24 -0800
committerJunio C Hamano <gitster@pobox.com>2012-02-12 22:43:24 -0800
commitd1168b903320fc7c2c422ed08f881379e0bd8f35 (patch)
tree6bafe86f334ae731d46f3c4bbc64ff6e1c7cd113
parent2ef80c2d8998593852be2fb0546c8e4a518a6bf1 (diff)
parent84d9e2d50ca9fbcf34e31cb74797fc182187c7b5 (diff)
downloadgit-d1168b903320fc7c2c422ed08f881379e0bd8f35.tar.gz
git-d1168b903320fc7c2c422ed08f881379e0bd8f35.tar.xz
Merge branch 'jn/gitweb-search-utf-8'
* jn/gitweb-search-utf-8: gitweb: Allow UTF-8 encoded CGI query parameters and path_info Conflicts: gitweb/gitweb.perl
-rwxr-xr-xgitweb/gitweb.perl14
1 files changed, 7 insertions, 7 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 9ee58114d..87a95e276 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -52,7 +52,7 @@ sub evaluate_uri {
# as base URL.
# Therefore, if we needed to strip PATH_INFO, then we know that we have
# to build the base URL ourselves:
- our $path_info = $ENV{"PATH_INFO"};
+ our $path_info = decode_utf8($ENV{"PATH_INFO"});
if ($path_info) {
if ($my_url =~ s,\Q$path_info\E$,, &&
$my_uri =~ s,\Q$path_info\E$,, &&
@@ -817,9 +817,9 @@ sub evaluate_query_params {
while (my ($name, $symbol) = each %cgi_param_mapping) {
if ($symbol eq 'opt') {
- $input_params{$name} = [ $cgi->param($symbol) ];
+ $input_params{$name} = [ map { decode_utf8($_) } $cgi->param($symbol) ];
} else {
- $input_params{$name} = $cgi->param($symbol);
+ $input_params{$name} = decode_utf8($cgi->param($symbol));
}
}
}
@@ -2775,7 +2775,7 @@ sub git_populate_project_tagcloud {
}
my $cloud;
- my $matched = $cgi->param('by_tag');
+ my $matched = $input_params{'ctag'};
if (eval { require HTML::TagCloud; 1; }) {
$cloud = HTML::TagCloud->new;
foreach my $ctag (sort keys %ctags_lc) {
@@ -3906,7 +3906,7 @@ sub print_search_form {
-values => ['commit', 'grep', 'author', 'committer', 'pickaxe']) .
$cgi->sup($cgi->a({-href => href(action=>"search_help")}, "?")) .
" search:\n",
- $cgi->textfield(-name => "s", -value => $searchtext) . "\n" .
+ $cgi->textfield(-name => "s", -value => $searchtext, -override => 1) . "\n" .
"<span title=\"Extended regular expression\">" .
$cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
-checked => $search_use_regexp) .
@@ -5345,7 +5345,7 @@ sub git_project_list_body {
my $check_forks = gitweb_check_feature('forks');
my $show_ctags = gitweb_check_feature('ctags');
- my $tagfilter = $show_ctags ? $cgi->param('by_tag') : undef;
+ my $tagfilter = $show_ctags ? $input_params{'ctag'} : undef;
$check_forks = undef
if ($tagfilter || $searchtext);
@@ -6261,7 +6261,7 @@ sub git_tag {
sub git_blame_common {
my $format = shift || 'porcelain';
- if ($format eq 'porcelain' && $cgi->param('js')) {
+ if ($format eq 'porcelain' && $input_params{'javascript'}) {
$format = 'incremental';
$action = 'blame_incremental'; # for page title etc
}