* [PATCH 1/2] view: account for filter bugs which leak HTML into the repo
@ 2014-11-13 21:53 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2014-11-13 21:53 UTC (permalink / raw)
To: meta; +Cc: Eric Wong
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
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-11-13 21:53 7% [PATCH 1/2] view: account for filter bugs which leak HTML into the repo Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).