From c1c9a153a2976de8eda424f5b7072ec6e7748ee6 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 10 Mar 2014 13:47:04 +0000 Subject: [PATCH] Try to force utf into entities. --- Webperl/Block.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Webperl/Block.pm b/Webperl/Block.pm index 78b3322..a200872 100644 --- a/Webperl/Block.pm +++ b/Webperl/Block.pm @@ -354,6 +354,9 @@ sub validate_htmlarea { my $text = $self -> {"cgi"} -> param($param); $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 my $scrubber = HTML::Scrubber -> new(); my $nohtml = $scrubber -> scrub($text);