aboutsummaryrefslogtreecommitdiff
path: root/gitweb/gitweb.perl
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2007-07-29 01:04:09 +0200
committerJunio C Hamano <gitster@pobox.com>2007-07-28 18:54:56 -0700
commitf22cca44ba5022d93bfd895ec08682fbda7efb8c (patch)
treec1e395e66e2ebfc3d6a400b66dd9e8ea6e3694b2 /gitweb/gitweb.perl
parent8b4aee015e2d81dc6cc53328aedc66742a5306d8 (diff)
downloadgit-f22cca44ba5022d93bfd895ec08682fbda7efb8c.tar.gz
git-f22cca44ba5022d93bfd895ec08682fbda7efb8c.tar.xz
gitweb: Allow for multivalued parameters passed to href subroutine
Make it possible to generate URLs with multivalued parameters in the href() subroutine, via passing reference to array of values. Example: href(action=>"log", extra_options=>["--no-merges", "--first-parent"]) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl8
1 files changed, 7 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8a3289965..498b936dd 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -629,7 +629,13 @@ sub href(%) {
for (my $i = 0; $i < @mapping; $i += 2) {
my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
if (defined $params{$name}) {
- push @result, $symbol . "=" . esc_param($params{$name});
+ if (ref($params{$name}) eq "ARRAY") {
+ foreach my $par (@{$params{$name}}) {
+ push @result, $symbol . "=" . esc_param($par);
+ }
+ } else {
+ push @result, $symbol . "=" . esc_param($params{$name});
+ }
}
}
$href .= "?" . join(';', @result) if scalar @result;