You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by fe...@apache.org on 2004/05/14 18:56:59 UTC

svn commit: rev 10649 - incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message

Author: felicity
Date: Fri May 14 09:56:59 2004
New Revision: 10649

Modified:
   incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
Log:
bug 3384: if a message came in with a doctype set, but no other html tags, we could get undefined/division by 0 errors when rendering/setting HTML results.

Modified: incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Node.pm	Fri May 14 09:56:59 2004
@@ -384,6 +384,8 @@
       $r->{ratio} = ($raw - $r->{html_length}) / $raw;
       if (exists $r->{elements} && exists $r->{tags}) {
 	$r->{bad_tag_ratio} = ($r->{tags} - $r->{elements}) / $r->{tags};
+      }
+      if (exists $r->{elements_seen} && exists $r->{tags_seen}) {
 	$r->{non_element_ratio} =
 	    ($r->{tags_seen} - $r->{elements_seen}) / $r->{tags_seen};
       }