in reply to Re: Removing malicious HTML entities (now with more questions!)
in thread Removing malicious HTML entities (now with more questions!)
PS. Latter I found out about grep trick to check if variable is in the array - should change this ...sub form { my $self = shift; my %params = @_; my $skip = array_to_hash($params{'skip_fields'}); # Array/ArrayRef my $q = $self->query(); my %vars = $q->Vars(); unless($params{dont_encode_fields}){ use HTML::Entities; foreach(keys %vars){ next if $skip->{$_}; # Don't encode if it's in skip list $vars{$_} = HTML::Entities::encode_entities($vars{$_}, '<> +&"'); } } return \%vars; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Removing malicious HTML entities (now with more questions!)
by Jenda (Abbot) on Aug 16, 2008 at 21:16 UTC | |
by techcode (Hermit) on Aug 17, 2008 at 02:35 UTC |