From 08df33b5c25577cf42d7f524eeaa367cbde886fb Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Mon, 15 Oct 2012 09:38:13 -0400
Subject: [PATCH] Partially revert 9546d22c6: don't validate with parse_charset()
---
program/include/rcube_message.php | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index 6af1d01..7bf95d1 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -371,6 +371,10 @@
foreach ($structure->parts as $p => $sub_part) {
$sub_mimetype = $sub_part->mimetype;
+ // skip empty parts
+ if (!$sub_part->size)
+ continue;
+
// check if sub part is
if ($sub_mimetype == 'text/plain')
$plain_part = $p;
@@ -494,8 +498,13 @@
}
// list as attachment as well
- if (!empty($mail_part->filename))
+ if (!empty($mail_part->filename)) {
$this->attachments[] = $mail_part;
+ }
+ // list html part as attachment (here the part is most likely inside a multipart/related part)
+ else if ($this->parse_alternative && ($secondary_type == 'html' && !$this->opt['prefer_html'])) {
+ $this->attachments[] = $mail_part;
+ }
}
// part message/*
else if ($primary_type == 'message') {
--
Gitblit v1.9.1