summaryrefslogtreecommitdiff
path: root/program/include/rcube_message.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-10-27 16:12:37 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-10-27 16:12:37 +0200
commitddafe4e4109a8d6d412c3c138412ee2ca3d58dbf (patch)
tree25bf6c599459a00b75c2ce95b59520d1e7ede7ec /program/include/rcube_message.php
parentf2d3fc1b5d66013c265d82891b8526389303eff3 (diff)
parent033cb2105aebf06d46ba13471de5dc5dc547e7bd (diff)
Merge branch 'dev-compose-newwindow'
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;
}