]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Add an option to href() to return full URL
authorJakub Narebski <redacted>
Sun, 19 Nov 2006 14:05:21 +0000 (15:05 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
href subroutine by default generates absolute URL (generated using
CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;
add an option to generate full URL using $my_url as base.

New feature usage: href(..., -full=>1)

Signed-off-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index a8d9748d3120701522f4a360e7dfc97a8755412cfb70b2adfdbc815932117398..5dd04c7fc6e9d608e3e9a4b0f1f4a727cb1560822067fe597aa604033add76ce 100755 (executable)
@@ -460,7 +460,8 @@ exit;
 
 sub href(%) {
        my %params = @_;
-       my $href = $my_uri;
+       # default is to use -absolute url() i.e. $my_uri
+       my $href = $params{-full} ? $my_url : $my_uri;
 
        # XXX: Warning: If you touch this, check the search form for updating,
        # too.
This page took 0.299076 seconds and 4 git commands to generate.