@matheusbsbs / matheus-bagliano / commits / bd5d1e42fb
Fork 0

gitweb: Add an option to href() to return full URL

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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Jakub Narebski committed Nov 19, 2006 at 15:05 UTC bd5d1e42fb8edffa4e35d1257f648d586b2d054c
1 file changed +2 -1
gitweb/gitweb.perl
+2 -1
@@ -459,7 +459,8 @@ exit;
459
460 sub href(%) {
461 my %params = @_;
462 - my $href = $my_uri;
462 + # default is to use -absolute url() i.e. $my_uri
463 + my $href = $params{-full} ? $my_url : $my_uri;
464
465 # XXX: Warning: If you touch this, check the search form for updating,
466 # too.