X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FHval.pm;h=c47057fc5f82cfea7c15ffa79d21dd5cc4106058;hb=3d41aa23f35501ca92aab8aa42980fa73f7fa74f;hp=0e199025adcec36d72d55e139900e1bf03f26edc;hpb=24a309bd1221a24ac673ece463f765f7a92921ff;p=public-inbox.git diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm index 0e199025..c47057fc 100644 --- a/lib/PublicInbox/Hval.pm +++ b/lib/PublicInbox/Hval.pm @@ -1,5 +1,5 @@ -# Copyright (C) 2014-2015 all contributors -# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt) +# Copyright (C) 2014-2018 all contributors +# License: AGPL-3.0+ # # represents a header value in various forms. Used for HTML generation # in our web interface(s) @@ -91,8 +91,9 @@ sub prurl { # ․ · and ͺ were also candidates: # https://public-inbox.org/meta/20170615015250.GA6484@starla/ # However, • was chosen to make copy+paste errors more obvious -sub obfuscate_addrs ($$) { +sub obfuscate_addrs ($$;$) { my $ibx = $_[0]; + my $repl = $_[2] || '•'; my $re = $ibx->{-no_obfuscate_re}; # regex of domains my $addrs = $ibx->{-no_obfuscate}; # { adddress => 1 } $_[1] =~ s/(([\w\.\+=\-]+)\@([\w\-]+\.[\w\.\-]+))/ @@ -100,7 +101,7 @@ sub obfuscate_addrs ($$) { if ($addrs->{$addr} || ((defined $re && $domain =~ $re))) { $addr; } else { - $domain =~ s!([^\.]+)\.!$1•!; + $domain =~ s!([^\.]+)\.!$1$repl!; $user . '@' . $domain } /sge;