Try to force utf into entities.

This commit is contained in:
Chris 2014-03-10 13:47:04 +00:00
parent 97340f55c8
commit c1c9a153a2

View File

@ -354,6 +354,9 @@ sub validate_htmlarea {
my $text = $self -> {"cgi"} -> param($param); my $text = $self -> {"cgi"} -> param($param);
$text = Encode::decode("utf8", $text) if(!Encode::is_utf8($text)); $text = Encode::decode("utf8", $text) if(!Encode::is_utf8($text));
# Convert anything that might cause problems to html entities.
encode_entities($text, '^\n\x20-\x7e');
# Get a copy of the input with no tags at all so that it can be checked for length # Get a copy of the input with no tags at all so that it can be checked for length
my $scrubber = HTML::Scrubber -> new(); my $scrubber = HTML::Scrubber -> new();
my $nohtml = $scrubber -> scrub($text); my $nohtml = $scrubber -> scrub($text);