summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1149fec)
raw | patch | inline | side by side (parent: 1149fec)
author | Jakub Narebski <jnareb@gmail.com> | |
Tue, 22 Aug 2006 17:05:25 +0000 (19:05 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 22 Aug 2006 23:12:27 +0000 (16:12 -0700) |
Restore pre-1c2a4f5addce479c619057c6cdc841802139982f
ordering of CGI parameters.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
ordering of CGI parameters.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 43b1600486c4c71c5004e42f918381110fec5224..50083e3011d145a25c7c56d85d75dd04ef15adf3 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
## action links
sub href(%) {
- my %mapping = (
+ my %params = @_;
+
+ my @mapping = (
action => "a",
project => "p",
file_name => "f",
page => "pg",
searchtext => "s",
);
+ my %mapping = @mapping;
- my %params = @_;
$params{"project"} ||= $project;
- my $href = "$my_uri?";
- $href .= esc_param( join(";",
- map {
- defined $params{$_} ? "$mapping{$_}=$params{$_}" : ()
- } keys %params
- ) );
-
- return $href;
+ my @result = ();
+ 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});
+ }
+ }
+ return "$my_uri?" . join(';', @result);
}