about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-06 08:32:52 +0000
committerEric Wong <e@yhbt.net>2020-04-07 19:37:39 +0000
commit78792fee4031aee0a8bd532bff98efc2b9409d68 (patch)
tree5fca984ab4c4faf18f5048d9b0eae1cace4e9d76 /lib/PublicInbox/View.pm
parent17a3d433a1e8617a1e957da8efe11875efaa0f62 (diff)
downloadpublic-inbox-78792fee4031aee0a8bd532bff98efc2b9409d68.tar.gz
We shouldn't rerun the address obfuscator on data we've
already run through.  Instead, run through the unescaped
text part and substitute the UTF-8 "\x{2022}" substitution
before it hits HTML escaping

Fixes: 9bdd81dc16ba6511 ("view: msg_iter calls add_body_text directly")
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index ddd94e48..33b323dc 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -532,6 +532,9 @@ sub add_text_body { # callback for msg_iter
         # link generation in diffs with the extra '%0D'
         $s =~ s/\r\n/\n/sg;
 
+        # will be escaped to `&#8226;' in HTML
+        obfuscate_addrs($ibx, $s, "\x{2022}") if $ibx->{obfuscate};
+
         # always support diff-highlighting, but we can't linkify hunk
         # headers for solver unless some coderepo are configured:
         my $diff;
@@ -589,8 +592,6 @@ sub add_text_body { # callback for msg_iter
                 }
                 undef $cur; # free memory
         }
-
-        obfuscate_addrs($ibx, $$rv) if $ibx->{obfuscate};
 }
 
 sub _msg_page_prepare_obuf {