Skip to content

Commit

Permalink
Merge branch 'jk/gitweb-with-newer-cgi-multi-param' into maint
Browse files Browse the repository at this point in the history
"gitweb" used to depend on a behaviour that was deprecated by recent
CGI.pm.

* jk/gitweb-with-newer-cgi-multi-param:
  gitweb: hack around CGI's list-context param() handling
  • Loading branch information
Junio C Hamano committed Dec 22, 2014
2 parents 8d51343 + 13dbf46 commit 0b5c641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
use Time::HiRes qw(gettimeofday tv_interval);
binmode STDOUT, ':utf8';

if (!defined($CGI::VERSION) || $CGI::VERSION < 4.08) {
eval 'sub CGI::multi_param { CGI::param(@_) }'
}

our $t0 = [ gettimeofday() ];
our $number_of_git_cmds = 0;

Expand Down Expand Up @@ -871,7 +875,7 @@ sub evaluate_query_params {

while (my ($name, $symbol) = each %cgi_param_mapping) {
if ($symbol eq 'opt') {
$input_params{$name} = [ map { decode_utf8($_) } $cgi->param($symbol) ];
$input_params{$name} = [ map { decode_utf8($_) } $cgi->multi_param($symbol) ];
} else {
$input_params{$name} = decode_utf8($cgi->param($symbol));
}
Expand Down

0 comments on commit 0b5c641

Please sign in to comment.