Skip to content

Commit bd5d1e4

Browse files
jnarebJunio C Hamano
authored andcommitted
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>
1 parent 59e3b14 commit bd5d1e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitweb/gitweb.perl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ sub evaluate_path_info {
459459

460460
sub href(%) {
461461
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;
463464

464465
# XXX: Warning: If you touch this, check the search form for updating,
465466
# too.

0 commit comments

Comments
 (0)