Gossamer Forum
Home : General : Perl Programming :

Re: [delicia] another encoding problem

Quote Reply
Re: [delicia] another encoding problem In reply to
i have tracked down the cause but i have no idea how to correct it. here's the code that parses the form input:
Code:
sub parse_form {
# --------------------------------------------------------
my (%in);
my ($buffer, $pair, $name, $value);
PAIR: foreach $name ($query->param()) {
@value = $query->param("$name");
$value = join '~~', @value;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($value eq "---") { next PAIR; }
if ($value eq "http://") { next PAIR; } # Removes default beginning of URLs
unless ($value) { next PAIR; }
$in{$name} = $value;
}
return %in;
}

when the above code was inserted another thing that was added before the call to parse form was
Code:
use CGI;
$query = new CGI;
Subject Author Views Date
Thread another encoding problem delicia 2384 Jul 21, 2022, 7:24 AM
Thread Re: [delicia] another encoding problem
delicia 2319 Jul 21, 2022, 6:20 PM
Thread Re: [delicia] another encoding problem
Andy 2312 Jul 22, 2022, 8:46 AM
Thread Re: [Andy] another encoding problem
delicia 2311 Jul 22, 2022, 9:20 AM
Thread Re: [delicia] another encoding problem
Andy 2303 Jul 22, 2022, 10:17 PM
Thread Re: [Andy] another encoding problem
delicia 2298 Jul 23, 2022, 5:41 AM
Post Re: [delicia] another encoding problem
Andy 2294 Jul 23, 2022, 5:51 AM