[Rt-commit] r16171 - in rt/3.8/trunk: .

falcone at bestpractical.com falcone at bestpractical.com
Tue Sep 30 13:52:06 EDT 2008


Author: falcone
Date: Tue Sep 30 13:52:05 2008
New Revision: 16171

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Template_Overlay.pm

Log:
 r40296 at ketch:  falcone | 2008-09-30 13:47:02 -0400
 * use in memory parsing, otherwise when you have an HTML
   template and _DowngradeToHTML is called, your open filehandles
   will get garbage collected and sending the html email will fail.


Modified: rt/3.8/trunk/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Template_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Template_Overlay.pm	Tue Sep 30 13:52:05 2008
@@ -346,13 +346,10 @@
         $content = "\n".$content;
     }
 
-    # Re-use the MIMEParser setup code from RT::EmailParser, which
-    # tries to use tmpdirs, falling back to in-memory parsing. But we
-    # don't stick the RT::EmailParser into a lexical because it cleans
-    # out the tmpdir it makes on DESTROY
     my $parser = MIME::Parser->new();
-    $self->{rtparser} = RT::EmailParser->new;
-    $self->{rtparser}->_SetupMIMEParser($parser);
+    $parser->output_to_core(1);
+    $parser->tmp_to_core(1);
+    $parser->use_inner_files(1);
 
     ### Should we forgive normally-fatal errors?
     $parser->ignore_errors(1);
@@ -438,7 +435,6 @@
 sub _DowngradeFromHTML {
     my $self = shift;
     my $orig_entity = $self->MIMEObj;
-    die 'hehe';
 
     local $RT::Transaction::PreferredContentType = 'text/plain';
 


More information about the Rt-commit mailing list