summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 248c648)
raw | patch | inline | side by side (parent: 248c648)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Thu, 12 Jul 2007 18:39:27 +0000 (20:39 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 12 Jul 2007 21:38:36 +0000 (14:38 -0700) |
Currently the only supported value is '--no-merges' for the 'rss', 'atom',
'log', 'shortlog' and 'history' actions, but it can be easily extended to allow
other parameters for other actions.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
'log', 'shortlog' and 'history' actions, but it can be easily extended to allow
other parameters for other actions.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 27580b567063d6dd8eb9e6d6de1f8036f9a6fb55..c8ba3a27a345b11aae29f8de74aed6e36f4f5a1d 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
}
}
+my %allowed_options = (
+ "--no-merges" => [ qw(rss atom log shortlog history) ],
+);
+
+our @extra_options = $cgi->param('opt');
+if (defined @extra_options) {
+ foreach(@extra_options)
+ {
+ if (not grep(/^$_$/, keys %allowed_options)) {
+ die_error(undef, "Invalid option parameter");
+ }
+ if (not grep(/^$action$/, @{$allowed_options{$_}})) {
+ die_error(undef, "Invalid option parameter for this action");
+ }
+ }
+}
+
our $hash_parent_base = $cgi->param('hpb');
if (defined $hash_parent_base) {
if (!validate_refname($hash_parent_base)) {
action => "a",
file_name => "f",
file_parent => "fp",
+ extra_options => "opt",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
($arg ? ($arg) : ()),
("--max-count=" . $maxcount),
("--skip=" . $skip),
+ @extra_options,
$commit_id,
"--",
($filename ? ($filename) : ())