https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6165

           Summary: ReplaceTags broken by zero-length lookbehind
                    assertions
           Product: Spamassassin
           Version: 3.2.5
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Plugins
        AssignedTo: [email protected]
        ReportedBy: [email protected]


The less-than sign in the lookbehind assertion syntax breaks ReplaceTags
processing, causing one or more tags to not be replaced.

Example:

[19314] dbg: replacetags: replacing replace_test: /(?<!http:\/\/)<OBFU_URI>/i
[19314] dbg: replacetags: replaced replace_test: /(?<!http:\/\/)<OBFU_URI>/i

Possible fix:

Index: ReplaceTags.pm
===================================================================
--- ReplaceTags.pm    (revision 797064 ( 
https://svn.apache.org/viewcvs.cgi?view=rev&rev=797064 ))
+++ ReplaceTags.pm    (working copy)
@@ -116,7 +116,7 @@

           # this will produce an array of tags to be replaced
           # for two adjacent tags, an element of "" will be between the two
-          my @re = split(/(<.+?>)/, $re);
+          my @re = split(/(<[^<>]+?>)/, $re);

           if ($pre_name) {
             my $pre = $conf->{replace_pre}->{$pre_name};

-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to