X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/927087639f1564dd6203150a0c7ad8b59ed4accbcb420b855344a4d276d4d71f..20e0ba5af98bb88e94fc0a714baf9e288e7a3bf20f7d3c0352e3b8b6d895da48:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 4a8bea0..aea8856 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -577,11 +577,10 @@ sub esc_html ($;%) { $str = to_utf8($str); $str = escapeHTML($str); - $str =~ s/\014/^L/g; # escape FORM FEED (FF) character (e.g. in COPYING file) - $str =~ s/\033/^[/g; # "escape" ESCAPE (\e) character (e.g. commit 20a3847d8a5032ce41f90dcc68abfb36e6fee9b1) if ($opts{'-nbsp'}) { $str =~ s/ / /g; } + $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg; return $str; } @@ -816,12 +815,11 @@ sub file_type_long { ## functions returning short HTML fragments, or transforming HTML fragments ## which don't beling to other sections -# format line of commit message or tag comment +# format line of commit message. sub format_log_line_html { my $line = shift; - $line = esc_html($line); - $line =~ s/ / /g; + $line = esc_html($line, -nbsp=>1); if ($line =~ m/([0-9a-fA-F]{40})/) { my $hash_text = $1; if (git_get_type($hash_text) eq "commit") { @@ -1880,17 +1878,17 @@ sub git_print_page_path { $fullname .= ($fullname ? '/' : '') . $dir; print $cgi->a({-href => href(action=>"tree", file_name=>$fullname, hash_base=>$hb), - -title => $fullname}, esc_path($dir)); + -title => esc_html($fullname)}, esc_path($dir)); print " / "; } if (defined $type && $type eq 'blob') { print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name, hash_base=>$hb), - -title => $name}, esc_path($basename)); + -title => esc_html($name)}, esc_path($basename)); } elsif (defined $type && $type eq 'tree') { print $cgi->a({-href => href(action=>"tree", file_name=>$file_name, hash_base=>$hb), - -title => $name}, esc_path($basename)); + -title => esc_html($name)}, esc_path($basename)); print " / "; } else { print esc_path($basename); @@ -2341,6 +2339,8 @@ sub git_patchset_body { print format_diff_line($patch_line); } + print "\n" if $in_header; # extended header + print "\n" if $patch_found; # class="patch" print "\n"; # class="patchset" @@ -2455,7 +2455,7 @@ sub git_project_list_body { $pr->{'age_string'} . "\n" . "