summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-11-15 18:58:32 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-11-15 18:58:32 +0100
commitf8101fff1ec4a52bde553e77a120fd8618c025aa (patch)
tree47133a91e84409b702d9f01e64d2ba98f2561fbe
parentf9a8189423a90cbe58c63d84a6dc21beaa795abc (diff)
Accept text/html parts inside multipart/mixed parts as HTML contents
-rw-r--r--program/lib/Roundcube/rcube_message.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php
index 278007610..f24ec3ed8 100644
--- a/program/lib/Roundcube/rcube_message.php
+++ b/program/lib/Roundcube/rcube_message.php
@@ -211,16 +211,19 @@ class rcube_message
}
$level = explode('.', $part->mime_id);
+ $depth = count($level);
// Check if the part belongs to higher-level's multipart part
- // this can be alternative/related/signed/encrypted, but not mixed
+ // this can be alternative/related/signed/encrypted or mixed
while (array_pop($level) !== null) {
- if (!count($level)) {
+ $parent_depth = count($level);
+ if (!$parent_depth) {
return true;
}
$parent = $this->mime_parts[join('.', $level)];
- if (!preg_match('/^multipart\/(alternative|related|signed|encrypted)$/', $parent->mimetype)) {
+ if (!preg_match('/^multipart\/(alternative|related|signed|encrypted|mixed)$/', $parent->mimetype)
+ || ($parent->mimetype == 'multipart/mixed' && $parent_depth < $depth - 1)) {
continue 2;
}
}