From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.6 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 854E9633805; Thu, 13 Nov 2014 21:53:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 1/2] view: account for filter bugs which leak HTML into the repo Date: Thu, 13 Nov 2014 21:53:00 +0000 Message-Id: <1415915581-2522-1-git-send-email-e@80x24.org> X-Mailer: git-send-email 2.2.0.rc0.1.g384e9bc List-Id: 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. --- lib/PublicInbox/View.pm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index e76d904..b09c3ba 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; -- EW