]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
view: fix obfuscation in message/* attachments
authorEric Wong <e@80x24.org>
Fri, 15 Nov 2024 02:59:32 +0000 (02:59 +0000)
committerEric Wong <e@80x24.org>
Fri, 15 Nov 2024 20:27:45 +0000 (20:27 +0000)
Our address obfuscation currently relies on HTML-escaped output,
so we need to call obfuscate_addrs() after ascii_html().  This
bug only affected rare messages which include another message/*
attachment.  Without this fix it didn't fail to obfuscate, but
rather showed the showed `&#8226;' in the HTML instead of the
entity it represents.

lib/PublicInbox/View.pm

index ad2592530acd253aa3a5c158b727c2948b0bb5d8..21cee63a791f1765807577bede7e86e02b2d37fc 100644 (file)
@@ -592,8 +592,9 @@ sub submsg_hdr ($$) {
        for my $h (qw(From To Cc Subject Date Message-ID X-Alt-Message-ID)) {
                $s .= "$h: $_\n" for $eml->header($h);
        }
+       $s = ascii_html($s);
        obfuscate_addrs($ctx->{-obfs_ibx}, $s) if $ctx->{-obfs_ibx};
-       ascii_html($s);
+       $s;
 }
 
 sub attach_link ($$$$;$) {