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 2019/06/13 15:03:40 UTC

svn commit: r1861265 - /spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm

Author: hege
Date: Thu Jun 13 15:03:40 2019
New Revision: 1861265

URL: http://svn.apache.org/viewvc?rev=1861265&view=rev
Log:
Bug 7374 - Some e-mails create "Complex regular subexpression recursion limit (32766) exceeded" warning

Modified:
    spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm

Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm?rev=1861265&r1=1861264&r2=1861265&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/HTML.pm Thu Jun 13 15:03:40 2019
@@ -750,7 +750,10 @@ sub html_text {
   my $invisible_for_bayes = 0;
 
   # NBSP:  UTF-8: C2 A0, ISO-8859-*: A0
-  if ($text !~ /^(?:[ \t\n\r\f\x0b]|\xc2\xa0)*\z/s) {
+  # Bug 7374 - regex recursion limit exceeded
+  #if ($text !~ /^(?:[ \t\n\r\f\x0b]|\xc2\xa0)*\z/s) {
+  # .. alternative way, remove from string and see if there's anything left
+  if (do {(my $tmp = $text) =~ s/(?:[ \t\n\r\f\x0b]|\xc2\xa0)//gs; length($tmp)}) {
     $invisible_for_bayes = $self->html_font_invisible($text);
   }