From 78792fee4031aee0a8bd532bff98efc2b9409d68 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 6 Apr 2020 08:32:52 +0000 Subject: view: do not redundantly obfuscate addresses 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") --- lib/PublicInbox/View.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/View.pm') 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 `•' 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 { -- cgit v1.2.3-24-ge0c7