fixed: Mail messages not properly decoded

This commit is contained in:
Graham Knop 2008-07-01 15:25:14 +00:00
parent a8d08634c6
commit 9d9175c176
2 changed files with 8 additions and 6 deletions

View file

@ -6,6 +6,7 @@
- fixed: Flat Discount Coupon: Add to Cart button seems broken
- fixed: Deleting unProtected user profile fields
- fixed: Synopsis doesn't update after editting posts
- fixed: Mail messages not properly decoded
7.5.14
- fixed: RSS feeds report modified date instead of create date

View file

@ -242,12 +242,13 @@ sub parseParts {
}
my $body = $message->bodyhandle;
if (defined $body) {
my $disposition = $message->head->get("Content-Disposition");
my $filename = "";
if($disposition =~ m/filename=\"(.*)\"/) {
$filename = $1;
}
return [{content => $body->as_string, type=>$type, filename=>$filename}];
my $filename = $message->head->mime_attr('content-disposition.filename');
my $decoder = Encode::find_encoding($message->head->mime_attr('content-type.charset'));
return [{
content => $decoder ? $decoder->decode($body->as_string) : $body->as_string,
type => $type,
filename => $filename,
}];
}
my @parts = ();
foreach my $part ($message->parts) {