summaryrefslogtreecommitdiff
path: root/program/include/rcube_message.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcube_message.php')
-rw-r--r--program/include/rcube_message.php20
1 files changed, 5 insertions, 15 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index d15cc7577..38d18171c 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -210,26 +210,16 @@ class rcube_message
if (!$recursive) {
$level = explode('.', $part->mime_id);
- // Level too high
- if (count($level) > 2) {
+ // Skip if level too deep or part has a file name
+ if (count($level) > 2 || $part->filename) {
continue;
}
// HTML part can be on the lower level, if not...
if (count($level) > 1) {
- // It can be an alternative or related message part
- // find parent part
- $parent = null;
- foreach ($this->mime_parts as $part) {
- if ($part->mime_id == $level[0]) {
- $parent = $part;
- }
- }
-
- if (!$parent) {
- continue;
- }
-
+ array_pop($level);
+ $parent = $this->mime_parts[join('.', $level)];
+ // ... parent isn't multipart/alternative or related
if ($parent->mimetype != 'multipart/alternative' && $parent->mimetype != 'multipart/related') {
continue;
}