Subject: | sub dump_html has bugs (non-escaped HTML ...) |
CGI has a Dump method, which will do SWEET dumping,
and all the values are properly escaped (escapeHTML).
If you still want the values to be sorted, you can simply
rip-off 'sub Dump' from CGI.pm and adjust it accordingly.
sub dump_html should look something like the following.
sub dump_html {
my $self = shift;
my $output = '';
my $q = $self->query;
# Dump Params
$output .= "<P>\nQuery Parameters:<BR>\n";
$output .= $q->Dump()."\n";
# Dump ENV
$output .= "<P>\nQuery Environment:<BR>\n<OL>\n";
foreach my $ek (sort(keys(%ENV))) {
$output .= "<LI> $ek => '<B>"
. $q->escapeHTML( $ENV{$ek} )
. "</B>'\n";
}
$output .= "</OL>\n";
return $output;
}
You should probably escapeHTML($ek) as well (you never know)