my $cache = 'blah=hi;cat /etc/passwd';
@pairs = split(/&/, $cache);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if (defined($FORM{$name})){
$FORM{$name}.="\0";
}
$FORM{$name} .= &strip($value);
}
sub strip {
my($cheese)= @_;
$cheese =~ s/\t/ /g;
$cheese =~ s/\|//g;
$cheese =~ s/\r//g; # should use this.
$cheese =~ s/\n/<P>/g; # should use this.
$cheese =~ s/%95/<li>/g;
$cheese =~ s/"<P><P>"/<P>/g;
return ($cheese);
}
Pardon me if I'm wrong but this does not strip out ;'s which gets really bad since I just spotted.