You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/04/07 15:08:03 UTC

svn commit: r1899653 - /spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm

Author: hege
Date: Thu Apr  7 15:08:03 2022
New Revision: 1899653

URL: http://svn.apache.org/viewvc?rev=1899653&view=rev
Log:
Bug 7969 - Parser.pm, sub finish_parsing, small code reorder

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm?rev=1899653&r1=1899652&r2=1899653&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Conf/Parser.pm Thu Apr  7 15:08:03 2022
@@ -911,16 +911,11 @@ sub finish_parsing {
 
         # Validate type
         my $expected_type = $conf->{eval_plugins_types}->{$function};
-        if (defined $expected_type) {
+        if (defined $expected_type && $expected_type != $type) {
           # Allow both body and rawbody if expecting body
-          if ($expected_type == $Mail::SpamAssassin::Conf::TYPE_BODY_EVALS) {
-            if ($type != $expected_type && $type != $Mail::SpamAssassin::Conf::TYPE_RAWBODY_EVALS) {
-              my $estr = $Mail::SpamAssassin::Conf::TYPE_AS_STRING{$expected_type};
-              $self->lint_warn("wrong rule type defined for $name, expected '$estr'");
-              next;
-            }
-          }
-          elsif ($type != $expected_type) {
+          if (!($expected_type == $Mail::SpamAssassin::Conf::TYPE_BODY_EVALS &&
+              $type == $Mail::SpamAssassin::Conf::TYPE_RAWBODY_EVALS))
+          {
             my $estr = $Mail::SpamAssassin::Conf::TYPE_AS_STRING{$expected_type};
             $self->lint_warn("wrong rule type defined for $name, expected '$estr'");
             next;