]> Pileus Git - ~andy/git/commitdiff
Merge branch 'gb/maint-gitweb-esc-param' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Nov 2009 00:37:39 +0000 (16:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Nov 2009 00:37:39 +0000 (16:37 -0800)
* gb/maint-gitweb-esc-param:
  gitweb: fix esc_param

gitweb/gitweb.perl

index c939e2434d5901f0de50c649c5443c026d545a98..59dca7d3ada7505f155e4aa7890e03b775043212 100755 (executable)
@@ -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;
 }