https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8414

--- Comment #7 from Kent Oyer <[email protected]> ---
I think we should get rid of the Goatse. 

--- lib/Mail/SpamAssassin/Handler/Image.pm      (revision 1938347)
+++ lib/Mail/SpamAssassin/Handler/Image.pm      (working copy)
@@ -355,7 +355,8 @@
   $node->set_rendered($text, $node->effective_type);
   # Accumulate per-message OCR image and word counts (used by
   # check_image_text_ratio to spot a mostly-text "image").
-  my $word_count = () = $text =~ /\S+/g;
+  my $word_count = 0;
+  $word_count++ while $text =~ /\S+/g;
   $pms->{plugins}{Image}{ocr_image_count}++;
   $pms->{plugins}{Image}{ocr_word_count} += $word_count;
   # Stash the text for imagetext rules (see _run_imagetext_rules); one entry
per
@@ -760,7 +761,9 @@
   # handle_image injects the OCR text via set_rendered, it already includes
the
   # image words -- so this is the total-body-word denominator.
   my $body_words = 0;
-  $body_words += () = $_ =~ /\S+/g for @$body;
+  foreach my $line (@$body) {
+    $body_words++ while $line =~ /\S+/g;
+  }
   return 0 unless $body_words;

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to