Mailing List Archive

svn commit: rev 9829 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin
Author: felicity
Date: Tue Mar 30 09:24:32 2004
New Revision: 9829

Modified:
incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm
Log:
bug 3230: don't allow 0-length tokens out of the bayes tokenizer

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm (original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Bayes.pm Tue Mar 30 09:24:32 2004
@@ -355,8 +355,8 @@
push(@tokens, $self->tokenize_line ($value, "H$prefix:", 0));
}

- # Go ahead and uniq the array
- my %tokens = map { $_ => 1 } @tokens;
+ # Go ahead and uniq the array, skip null tokens (can happen sometimes)
+ my %tokens = map { $_ => 1 } grep(length, @tokens);

# return the keys == tokens ...
keys %tokens;