X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI%2FBugreport.pm;h=64211884e1ac47d1e41961d267361801be82d9eb;hb=d36378ccdad74171fab90161276d5837b4dda874;hp=02f30c2f1c551114c226007173cf135edcd60a9b;hpb=a4c38b614a8350d84a53e942aca0d2914d9c56df;p=debbugs.git diff --git a/Debbugs/CGI/Bugreport.pm b/Debbugs/CGI/Bugreport.pm index 02f30c2..6421188 100644 --- a/Debbugs/CGI/Bugreport.pm +++ b/Debbugs/CGI/Bugreport.pm @@ -43,6 +43,7 @@ use POSIX qw(strftime); use Encode qw(decode_utf8 encode_utf8); use URI::Escape qw(uri_escape_utf8); use Scalar::Util qw(blessed); +use File::Temp; BEGIN{ ($VERSION) = q$Revision: 494 $ =~ /^Revision:\s+([^\s+])/; @@ -321,8 +322,9 @@ sub handle_email_message{ my $parser = MIME::Parser->new(); # Because we are using memory, not tempfiles, there's no need to # clean up here like in Debbugs::MIME - $parser->tmp_to_core(1); - $parser->output_to_core(1); + # this will be cleaned up once it goes out of scope + my $tempdir = File::Temp->newdir(); + $parser->output_under($tempdir->dirname()); $entity = $parser->parse_data( $email); } else { $entity = $email @@ -447,10 +449,10 @@ sub handle_record{ ) ) .'">mbox, '; my $parser = MIME::Parser->new(); - # Because we are using memory, not tempfiles, there's no need to - # clean up here like in Debbugs::MIME - $parser->tmp_to_core(1); - $parser->output_to_core(1); + + # this will be cleaned up once it goes out of scope + my $tempdir = File::Temp->newdir(); + $parser->output_under($tempdir->dirname()); my $entity = $parser->parse_data($record->{text}); my $r_l = reply_headers($entity); $output .= q(