spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r169589 - /spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm
Date Wed, 11 May 2005 05:21:41 GMT
Author: dos
Date: Tue May 10 22:21:41 2005
New Revision: 169589

URL: http://svn.apache.org/viewcvs?rev=169589&view=rev
Log:
bug 3846: verify RE before including a rule

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm?rev=169589&r1=169588&r2=169589&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm Tue May 10 22:21:41 2005
@@ -816,13 +816,16 @@
 sub is_regexp_valid {
   my ($self, $name, $re) = @_;
 
+  # get rid of the / delimiters in $re so we can verify it
+  $re =~ s/^\/(.*)\/$/$1/;
+
   if (eval { ("" =~ m{$re}); 1; }) {
     return 1;
   }
   else {
     my $err = $@;
     $err =~ s/ at .*? line \d+\.\n?//;
-    warn "config: invalid regexp for rule $name: $re: $err\n";
+    warn "config: invalid regexp for rule $name: /$re/: $err\n";
     $self->{conf}->{errors}++;
     return 0;
   }



Mime
View raw message