aboutsummaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorPavan Kumar Sunkara <pavan.sss1991@gmail.com>2010-07-15 12:59:01 +0530
committerJunio C Hamano <gitster@pobox.com>2010-07-15 11:59:37 -0700
commit109988f2cb00f78b746d05c40b8a8960bbb12ff8 (patch)
tree94e6eb10a2cca1e0173bdae8eb9a52fc544b7672 /gitweb
parent1b79d1c2a8a90419238f7213870ab1dc465082fe (diff)
downloadgit-109988f2cb00f78b746d05c40b8a8960bbb12ff8.tar.gz
git-109988f2cb00f78b746d05c40b8a8960bbb12ff8.tar.xz
gitweb: fix esc_url
Earlier, 452e225 (gitweb: fix esc_param, 2009-10-13) fixed CGI escaping rules used in esc_url. A very similar logic exists in esc_param and needs to be fixed the same way. Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl3
1 files changed, 1 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c356e95f1..a97ce0344 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1173,8 +1173,7 @@ sub esc_param {
sub esc_url {
my $str = shift;
return undef unless defined $str;
- $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;
}