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/Hval.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Hval.pm') diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index 79005d21..23233f0e 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -78,7 +78,7 @@ sub prurl ($$) { # However, • was chosen to make copy+paste errors more obvious sub obfuscate_addrs ($$;$) { my $ibx = $_[0]; - my $repl = $_[2] || '•'; + my $repl = $_[2] // '•'; my $re = $ibx->{-no_obfuscate_re}; # regex of domains my $addrs = $ibx->{-no_obfuscate}; # { adddress => 1 } $_[1] =~ s/(([\w\.\+=\-]+)\@([\w\-]+\.[\w\.\-]+))/ -- cgit v1.2.3-24-ge0c7