]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ContentHash.pm
content_hash: normalize whitespace before hashing addresses
[public-inbox.git] / lib / PublicInbox / ContentHash.pm
index f6ae9011c1bf2d471e239550fd7347c85adbeb3f..bacc9cdda12498abbb0ada5d2a2e2faec10190f2 100644 (file)
@@ -20,6 +20,7 @@ use Digest::SHA;
 sub digest_addr ($$$) {
        my ($dig, $h, $v) = @_;
        $v =~ tr/"//d;
+       $v =~ tr/\r\n\t / /s;
        $v =~ s/@([a-z0-9\_\.\-\(\)]*([A-Z])\S*)/'@'.lc($1)/ge;
        utf8::encode($v);
        $dig->add("$h\0$v\0");