]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Hval.pm
view: do not redundantly obfuscate addresses
[public-inbox.git] / lib / PublicInbox / Hval.pm
index 5f7ab513b11d9d3f0cc61459153c6c067f8c0f7d..23233f0e7e979c8ff524e1864a46489a747512c9 100644 (file)
@@ -55,7 +55,6 @@ sub src_escape ($) {
 
 sub ascii_html {
        my ($s) = @_;
-       $s =~ s/\r\n/\n/sg; # fixup bad line endings
        $s =~ s/([<>&'"\x7f\x00-\x1f])/$xhtml_map{$1}/sge;
        $enc_ascii->encode($s, Encode::HTMLCREF);
 }
@@ -79,7 +78,7 @@ sub prurl ($$) {
 # However, &#8226; was chosen to make copy+paste errors more obvious
 sub obfuscate_addrs ($$;$) {
        my $ibx = $_[0];
-       my $repl = $_[2] || '&#8226;';
+       my $repl = $_[2] // '&#8226;';
        my $re = $ibx->{-no_obfuscate_re}; # regex of domains
        my $addrs = $ibx->{-no_obfuscate}; # { adddress => 1 }
        $_[1] =~ s/(([\w\.\+=\-]+)\@([\w\-]+\.[\w\.\-]+))/