Skip to content

Commit

Permalink
gitweb: Do not esc_html $basedir argument to git_print_tree_entry
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Oct 22, 2006
1 parent e7fb022 commit 300454f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand Down Expand Up @@ -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";
Expand All @@ -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";
}
Expand Down

0 comments on commit 300454f

Please sign in to comment.