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/01/20 21:31:48 UTC

svn commit: rev 6239 - incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin

Author: felicity
Date: Tue Jan 20 12:31:47 2004
New Revision: 6239

Modified:
   incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/PerMsgStatus.pm
Log:
bug 2291: routines to process body text could be run multiple times due to lack of caching of results.


Modified: incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/PerMsgStatus.pm	(original)
+++ incubator/spamassassin/branches/b2_6_0/lib/Mail/SpamAssassin/PerMsgStatus.pm	Tue Jan 20 12:31:47 2004
@@ -1046,6 +1046,9 @@
 
 sub get_decoded_body_text_array {
   my ($self) = @_;
+
+  if (defined $self->{decoded_body_text_array}) { return $self->{decoded_body_text_array}; }
+
   local ($_);
   my $textary = $self->get_raw_body_text_array();
 
@@ -1092,6 +1095,7 @@
       }
     }
     push (@decoded, $self->split_b64_decode ($_));
+    $self->{decoded_body_text_array} = \@decoded;
     return \@decoded;
   }
   elsif ($self->{found_encoding_quoted_printable}) {
@@ -1099,6 +1103,7 @@
     s/\=\r?\n//gs;
     s/\=([0-9A-F]{2})/chr(hex($1))/ge;
     my @ary = $self->split_into_array_of_short_lines ($_);
+    $self->{decoded_body_text_array} = \@ary;
     return \@ary;
   }
   elsif ($self->{found_encoding_uuencode}) {
@@ -1126,9 +1131,11 @@
     }
     s/\r//;
     my @ary = $self->split_into_array_of_short_lines ($_);
+    $self->{decoded_body_text_array} = \@ary;
     return \@ary;
   }
   else {
+    $self->{decoded_body_text_array} = $textary;
     return $textary;
   }
 }
@@ -1157,6 +1164,9 @@
 
 sub get_decoded_stripped_body_text_array {
   my ($self) = @_;
+
+  if (defined $self->{decoded_stripped_body_text_array}) { return $self->{decoded_stripped_body_text_array}; }
+
   local ($_);
 
   my $bodytext = $self->get_decoded_body_text_array();
@@ -1283,6 +1293,7 @@
   $text =~ tr/\f/\n/;			# form feeds => newline
 
   my @textary = $self->split_into_array_of_short_lines ($text);
+  $self->{decoded_stripped_body_text_array} = \@textary;
 
   return \@textary;
 }