X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gitweb%2Fgitweb.perl;h=c77cd0341d98f6a38af55c6ed6f09704abf4e967;hb=03c6e97f809e5b89089a2c689d6a319e8d471455;hp=24b219310a73f6ff8412b9236e7e5a95a7860e2f;hpb=d821c003f80ed9dec813888f936b83eeedca20f6;p=git.git
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b219310..c77cd0341 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1083,8 +1083,7 @@ sub to_utf8 {
# correct, but quoted slashes look too horrible in bookmarks
sub esc_param {
my $str = shift;
- $str =~ s/([^A-Za-z0-9\-_.~()\/:@])/sprintf("%%%02X", ord($1))/eg;
- $str =~ s/\+/%2B/g;
+ $str =~ s/([^A-Za-z0-9\-_.~()\/:@ ]+)/CGI::escape($1)/eg;
$str =~ s/ /\+/g;
return $str;
}
@@ -5065,7 +5064,8 @@ sub git_blob {
chomp $line;
$nr++;
$line = untabify($line);
- printf "
\n",
+ printf "\n",
$nr, $nr, $nr, esc_html($line, -nbsp=>1);
}
}
@@ -5328,7 +5328,7 @@ sub git_commit {
} @$parents ) .
')';
}
- if (gitweb_check_feature('patches')) {
+ if (gitweb_check_feature('patches') && @$parents <= 1) {
$formats_nav .= " | " .
$cgi->a({-href => href(action=>"patch", -replay=>1)},
"patch");
@@ -5616,7 +5616,7 @@ sub git_commitdiff {
$formats_nav =
$cgi->a({-href => href(action=>"commitdiff_plain", -replay=>1)},
"raw");
- if ($patch_max) {
+ if ($patch_max && @{$co{'parents'}} <= 1) {
$formats_nav .= " | " .
$cgi->a({-href => href(action=>"patch", -replay=>1)},
"patch");
@@ -5824,7 +5824,7 @@ sub git_commitdiff_plain {
# format-patch-style patches
sub git_patch {
- git_commitdiff(-format => 'patch', -single=> 1);
+ git_commitdiff(-format => 'patch', -single => 1);
}
sub git_patches {