aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl27
1 files changed, 27 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0e1de297e..1471d4dad 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -185,6 +185,33 @@ $actions{$action}->();
exit;
## ======================================================================
+## action links
+
+sub href(%) {
+ my %mapping = (
+ action => "a",
+ project => "p",
+ file_name => "f",
+ hash => "h",
+ hash_parent => "hp",
+ hash_base => "hb",
+ page => "pg",
+ searchtext => "s",
+ );
+
+ my %params = @_;
+ $params{"project"} ||= $project;
+
+ my $href = "$my_uri?";
+ $href .= esc_param( join(";",
+ map { "$mapping{$_}=$params{$_}" } keys %params
+ ) );
+
+ return $href;
+}
+
+
+## ======================================================================
## validation, quoting/unquoting and escaping
sub validate_input {