about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-11-13 21:20:29 +0000
committerEric Wong <e@80x24.org>2014-11-13 21:20:29 +0000
commit75f6b34d08825b8d80de1ceda2a37e18ddde75a6 (patch)
tree3ed0bc81f29f16c5ca31a284cc39c2c9c06f688b /lib
parente09d9faf6056e1f5748abeafe682c6e1c30558ba (diff)
downloadpublic-inbox-75f6b34d08825b8d80de1ceda2a37e18ddde75a6.tar.gz
Ugh, apparently there's a (yet-to-be-fixed) bug in the Filter
code which caused an HTML message portion of a multipart message
to be displayed on the web UI.  Account for that and nuke it.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/View.pm14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index e76d904e..b09c3ba1 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -104,7 +104,12 @@ sub index_entry {
         $mime->walk_parts(sub {
                 my ($part) = @_;
                 return if $part->subparts; # walk_parts already recurses
-                my $enc = enc_for($part->content_type) || $enc_msg || $enc_utf8;
+                my $ct = $part->content_type;
+
+                # account for filter bugs...
+                return if defined $ct && $ct =~ m!\btext/[xh]+tml\b!i;
+
+                my $enc = enc_for($ct) || $enc_msg || $enc_utf8;
 
                 if ($part_nr > 0) {
                         my $fn = $part->filename;
@@ -178,7 +183,12 @@ sub multipart_text_as_html {
         $mime->walk_parts(sub {
                 my ($part) = @_;
                 return if $part->subparts; # walk_parts already recurses
-                my $enc = enc_for($part->content_type) || $enc_msg || $enc_utf8;
+                my $ct = $part->content_type;
+
+                # account for filter bugs...
+                return if defined $ct && $ct =~ m!\btext/[xh]+tml\b!i;
+
+                my $enc = enc_for($ct) || $enc_msg || $enc_utf8;
 
                 if ($part_nr > 0) {
                         my $fn = $part->filename;