From: Junio C Hamano Date: Mon, 16 Nov 2009 00:37:39 +0000 (-0800) Subject: Merge branch 'gb/maint-gitweb-esc-param' into maint X-Git-Tag: v1.6.5.3~18 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/14d52b28158ba7922adfc00ee488f934ef6d0593?ds=inline;hp=-c Merge branch 'gb/maint-gitweb-esc-param' into maint * gb/maint-gitweb-esc-param: gitweb: fix esc_param --- 14d52b28158ba7922adfc00ee488f934ef6d0593 diff --combined gitweb/gitweb.perl index c939e2434d,4b21ad25df..59dca7d3ad --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@@ -1083,8 -1083,7 +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; } @@@ -5328,7 -5327,7 +5327,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 -5615,7 +5615,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 -5823,7 +5823,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 {