Commit ab73b625 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 405404: HTML::Scrubber throws "undef error - Wide character in subroutine…

Bug 405404: HTML::Scrubber throws "undef error - Wide character in subroutine entry" when a field filtered with html_light contains UTF-8 characters - Patch by Fré©ric Buclin <LpSolit@gmail.com> r/a=mkanat
parent 38266465
...@@ -107,8 +107,7 @@ sub html_light_quote { ...@@ -107,8 +107,7 @@ sub html_light_quote {
require HTML::Parser; require HTML::Parser;
}; };
# We need utf8_mode() from HTML::Parser 3.40. if ($@) { # Package(s) not installed.
if ($@ || $HTML::Parser::VERSION < 3.40) { # Package(s) not installed.
my $safe = join('|', @allow); my $safe = join('|', @allow);
my $chr = chr(1); my $chr = chr(1);
...@@ -172,12 +171,6 @@ sub html_light_quote { ...@@ -172,12 +171,6 @@ sub html_light_quote {
comment => 0, comment => 0,
process => 0); process => 0);
# Avoid filling the web server error log.
# In HTML::Scrubber 0.08, the HTML::Parser object is stored in
# the "_p" key, but this may change in future versions.
if (ref($scrubber->{_p}) eq 'HTML::Parser') {
$scrubber->{_p}->utf8_mode(1);
}
return $scrubber->scrub($text); return $scrubber->scrub($text);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment