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:32:28 UTC

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

Author: felicity
Date: Tue Jan 20 12:32:27 2004
New Revision: 6240

Modified:
   incubator/spamassassin/trunk/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/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm
==============================================================================
--- incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	(original)
+++ incubator/spamassassin/trunk/lib/Mail/SpamAssassin/PerMsgStatus.pm	Tue Jan 20 12:32:27 2004
@@ -1095,6 +1095,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();
 
@@ -1141,6 +1144,7 @@
       }
     }
     push (@decoded, $self->split_b64_decode ($_));
+    $self->{decoded_body_text_array} = \@decoded;
     return \@decoded;
   }
   elsif ($self->{found_encoding_quoted_printable}) {
@@ -1148,6 +1152,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}) {
@@ -1175,9 +1180,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;
   }
 }
@@ -1206,6 +1213,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();
@@ -1284,6 +1294,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;
 }