Merge branch 'jk/gitweb-with-newer-cgi-multi-param' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:17:34 +0000 (12:17 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Dec 2014 20:17:34 +0000 (12:17 -0800)
"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

gitweb/gitweb.perl
index ccf75169dd6fb50e2f8ce584af8fa7841fa55fd6..7a5b23acf2155fb4e39dcb2f20944362cfbe0ac7 100755 (executable)
 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;
 
@@ -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));
                }