Work around bugs in HTML::Entities, which doesn't output strict utf8, and

DBD::mysql, which doesn't encode high characters correctly.  This shows up
in the Post synopsis, HTML::splitTag and Post->getSynopsisAndContent.
This commit is contained in:
Colin Kuskie 2009-07-07 22:24:00 +00:00
parent d6e242f8b2
commit b89486d5f3
4 changed files with 121 additions and 89 deletions

View file

@ -434,6 +434,7 @@ sub splitTag {
while (my $token = $p->get_tag($tag)) {
my $text = $p->get_trimmed_text("/$tag");
utf8::upgrade($text); ##PATCH to work around HTML::Entities and DBD::mysql
next if $text =~ /^([[:space:]]|[[:^print:]])*$/; # skip whitespace
push @result, $text; # add the text between the tags to the result array
last if @result == $count; # if we have a full count then quit