diff options
author | Jakub Narebski <jnareb@gmail.com> | 2006-10-21 19:53:09 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-10-23 00:24:37 +0400 |
commit | 300454feaba846b6bf95625c607d7096d81d26eb (patch) | |
tree | 1e7ca90d7c8f98d2b3a38158739d4b79804eb292 /gitweb | |
parent | e7fb022a42a83cbdb33e40f82ffca28eceb423c9 (diff) |
gitweb: Do not esc_html $basedir argument to git_print_tree_entry
In git_tree, rename $base variable (which is passed as $basedir
argument to git_print_tree_entry) to $basedir. Do not esc_html
$basedir, as it is part of file_name ('f') argument in link and not
printed. Add '/' at the end only if $basedir is not empty (it is empty
for top directory) and doesn't end in '/' already.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index d01ac9439a..23b26a2db2 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2783,7 +2783,7 @@ sub git_tree { my $refs = git_get_references(); my $ref = format_ref_marker($refs, $hash_base); git_header_html(); - my $base = ""; + my $basedir = ''; my ($have_blame) = gitweb_check_feature('blame'); if (defined $hash_base && (my %co = parse_commit($hash_base))) { my @views_nav = (); @@ -2811,7 +2811,10 @@ sub git_tree { print "<div class=\"title\">$hash</div>\n"; } if (defined $file_name) { - $base = esc_html("$file_name/"); + $basedir = $file_name; + if ($basedir ne '' && substr($basedir, -1) ne '/') { + $basedir .= '/'; + } } git_print_page_path($file_name, 'tree', $hash_base); print "<div class=\"page_body\">\n"; @@ -2827,7 +2830,7 @@ sub git_tree { } $alternate ^= 1; - git_print_tree_entry(\%t, $base, $hash_base, $have_blame); + git_print_tree_entry(\%t, $basedir, $hash_base, $have_blame); print "</tr>\n"; } |