From: Martin Mares Date: Mon, 23 Sep 2002 12:37:32 +0000 (+0000) Subject: Fix escaping of "+" characters in outgoing parameters. (BTW: when Galeon X-Git-Tag: holmes-import~1342 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9f87c6fe6552ce8b2236a07307d2f825b0e4c439;p=libucw.git Fix escaping of "+" characters in outgoing parameters. (BTW: when Galeon displays link URL's in the status line, it unqotes them improperly!) Use ":" as a separator instead of "&" when constructing self-ref URL's. --- diff --git a/lib/perl/CGI.pm b/lib/perl/CGI.pm index 286bca52..462b0c43 100644 --- a/lib/perl/CGI.pm +++ b/lib/perl/CGI.pm @@ -23,7 +23,7 @@ BEGIN { sub url_escape($) { my $x = shift @_; - $x =~ s/([^-\$_.+!*'(),0-9A-Za-z\x80-\xff ])/"%".unpack('H2',$1)/ge; + $x =~ s/([^-\$_.!*'(),0-9A-Za-z\x80-\xff ])/"%".unpack('H2',$1)/ge; $x =~ s/ /+/g; return $x; } @@ -42,7 +42,7 @@ our $arg_table; sub parse_arg_string($) { my ($s) = @_; $s =~ s/\s+//; - foreach $_ (split /&/,$s) { + foreach $_ (split /[&:]/,$s) { (/^([^=]+)=(.*)$/) or next; my $arg = $arg_table->{$1} or next; $_ = $2; @@ -106,7 +106,7 @@ sub make_out_args($) { sub self_ref(@) { my %h = @_; my $out = make_out_args(\%h); - return "?" . join('&', map { "$_=" . url_escape($out->{$_}) } sort keys %$out); + return "?" . join(':', map { "$_=" . url_escape($out->{$_}) } sort keys %$out); } sub self_form(@) {