[Rt-commit] r13449 - rt/3.8/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Fri Jun 20 11:13:54 EDT 2008


Author: ruz
Date: Fri Jun 20 11:13:54 2008
New Revision: 13449

Modified:
   rt/3.8/trunk/lib/RT/Template_Overlay.pm

Log:
* parse_data methdo open our scalar as stream without IO
  layears when we want to leave them, so open scalar
  ourself and use ->parse method instead

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	Fri Jun 20 11:13:54 2008
@@ -357,7 +357,11 @@
 
     ### Should we forgive normally-fatal errors?
     $parser->ignore_errors(1);
-    $self->{'MIMEObj'} = eval { $parser->parse_data($content) };
+
+    open my $stream, "<:utf8", \$content
+        or return (0, $self->loc("Couldn't open stream for parsing MIME::Entity: $!"));
+
+    $self->{'MIMEObj'} = eval { $parser->parse( $stream ) };
     if ( my $error = $@ || $parser->last_error ) {
         $RT::Logger->error( "$error" );
         return ( 0, $error );


More information about the Rt-commit mailing list