Skip to content

Commit 3550ea7

Browse files
Oblomovgitster
authored andcommitted
gitweb: use_pathinfo filenames start with /
Generate PATH_INFO URLs in the form project/action/hash_base:/filename rather than project/action/hash_base:filename (the latter form is still accepted in input). This minimal change allows relative navigation to work properly when viewing HTML files in raw ('blob_plain') mode. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b02bd7a commit 3550ea7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gitweb/gitweb.perl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ (%)
734734
# try to put as many parameters as possible in PATH_INFO:
735735
# - project name
736736
# - action
737-
# - hash or hash_base:filename
737+
# - hash or hash_base:/filename
738738

739739
# When the script is the root DirectoryIndex for the domain,
740740
# $href here would be something like http://gitweb.example.com/
@@ -753,11 +753,11 @@ (%)
753753
delete $params{'action'};
754754
}
755755

756-
# Finally, we put either hash_base:file_name or hash
756+
# Finally, we put either hash_base:/file_name or hash
757757
if (defined $params{'hash_base'}) {
758758
$href .= "/".esc_url($params{'hash_base'});
759759
if (defined $params{'file_name'}) {
760-
$href .= ":".esc_url($params{'file_name'});
760+
$href .= ":/".esc_url($params{'file_name'});
761761
delete $params{'file_name'};
762762
}
763763
delete $params{'hash'};

0 commit comments

Comments
 (0)