Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1:/tmp/cvs-serv9180/Classifier
Modified Files:
Bayes.pm
Log Message:
Added code to make sure that magnets do not have trailing or leading space and to automatically fix old magnets saved in the magnets files that have leading and trailing space
Index: Bayes.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/Bayes.pm,v
retrieving revision 1.106
retrieving revision 1.107
diff -C2 -d -r1.106 -r1.107
*** Bayes.pm 28 Feb 2003 00:08:50 -0000 1.106
--- Bayes.pm 28 Feb 2003 00:21:03 -0000 1.107
***************
*** 444,447 ****
--- 444,454 ----
my $value = $2;
+ # Some people were accidently creating magnets with trailing whitespace
+ # which really confused them later when their magnet did not match (see
+ # comment in UI::HTML::magnet for more detail)
+
+ $value =~ s/^[ \t]+//g;
+ $value =~ s/[ \t]+$//g;
+
$value =~ s/\\(\?|\*|\||\(|\)|\[|\]|\{|\}|\^|\$|\.)/$1/g;
$self->{magnets}{$bucket}{$type}{$value} = 1;
|