Url encode + so that roc's bonsai links work.

Bug  r=bear
This commit is contained in:
cls%seawood.org 2006-06-09 19:05:13 +00:00
parent 392135243f
commit 83eaf89a6b
2 changed files with 4 additions and 19 deletions
webtools
registry
tinderbox

@ -58,5 +58,6 @@ sub url_encode {
$s =~ s/\'/\%27/g;
$s =~ s/\|/\%7c/g;
$s =~ s/\&/\%26/g;
$s =~ s/\+/\%2b/g;
return $s;
}

@ -270,6 +270,7 @@ sub url_encode {
$s =~ s/\'/\%27/g;
$s =~ s/\|/\%7c/g;
$s =~ s/\&/\%26/g;
$s =~ s/\+/\%2b/g;
return $s;
}
@ -773,30 +774,13 @@ sub make_cgi_args {
for $k (sort keys %form){
$ret .= ($ret eq "" ? '?' : '&');
$v = $form{$k};
$ret .= &url_encode2($k);
$ret .= &url_encode($k);
$ret .= '=';
$ret .= &url_encode2($v);
$ret .= &url_encode($v);
}
return $ret;
}
sub url_encode2 {
local( $s ) = @_;
$s =~ s/\%/\%25/g;
$s =~ s/\=/\%3d/g;
$s =~ s/\?/\%3f/g;
$s =~ s/ /\%20/g;
$s =~ s/\n/\%0a/g;
$s =~ s/\r//g;
$s =~ s/\"/\%22/g;
$s =~ s/\'/\%27/g;
$s =~ s/\|/\%7c/g;
$s =~ s/\&/\%26/g;
$s =~ s/\+/\%2b/g;
return $s;
}
@weekdays = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
@months = ('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');