Skip to content

Commit

Permalink
gitweb: fix esc_url
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
pksunkara authored and gitster committed Jul 15, 2010
1 parent 1b79d1c commit 109988f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 109988f

Please sign in to comment.