From 109988f2cb00f78b746d05c40b8a8960bbb12ff8 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Thu, 15 Jul 2010 12:59:01 +0530 Subject: 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 Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gitweb') diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c356e95f18..a97ce03444 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; } -- cgit v1.2.3