diff options
author | Eric Wong <e@80x24.org> | 2014-04-06 06:50:08 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-04-06 06:50:08 +0000 |
commit | 127cde0f48d802f324c170e97477203e5bf8ad73 (patch) | |
tree | dd45df093e9bd090a5393313b2050d561d9c2d48 | |
parent | cd9dc9aee6cfaf6358f8b338d2e99ff6a8dfd711 (diff) | |
download | public-inbox-127cde0f48d802f324c170e97477203e5bf8ad73.tar.gz |
Our Filter class now passes through application/octet-stream if it looks like text (because some mailers suck); so we cannot trust the specified Content-Type of a message.
-rw-r--r-- | lib/PublicInbox/View.pm | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 3f3fea5a..aea0dd1c 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -29,27 +29,20 @@ sub multipart_text_as_html { my ($part) = @_; return if $part->subparts; # walk_parts already recurses - my $part_type = $part->content_type; - if ($part_type =~ m!\btext/[a-z0-9\+\._-]+\b!i) { - my $fn = $part->filename; - - if ($part_nr > 0) { - defined($fn) or $fn = "part #" . ($part_nr + 1); - $rv .= add_filename_line($fn); - } - - if (defined $full_pfx) { - $rv .= add_text_body_short($part, $part_nr, - $full_pfx); - } else { - $rv .= add_text_body_full($part, $part_nr); - } - $rv .= "\n" unless $rv =~ /\n\z/s; + my $fn = $part->filename; + + if ($part_nr > 0) { + defined($fn) or $fn = "part #" . ($part_nr + 1); + $rv .= add_filename_line($fn); + } + + if (defined $full_pfx) { + $rv .= add_text_body_short($part, $part_nr, + $full_pfx); } else { - $rv .= "-- part #" . ($part_nr + 1) . " "; - $rv .= escapeHTML($part_type); - $rv .= " skipped\n"; + $rv .= add_text_body_full($part, $part_nr); } + $rv .= "\n" unless $rv =~ /\n\z/s; ++$part_nr; }); $rv; |