diff options
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_message.php | 9 | ||||
-rw-r--r-- | program/include/rcube_output_html.php | 11 |
2 files changed, 15 insertions, 5 deletions
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index 7bf95d1c5..c189df57d 100644 --- a/program/include/rcube_message.php +++ b/program/include/rcube_message.php @@ -210,15 +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 - $parent = $this->mime_parts[0]; + 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; } diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php index 6138e2a30..616ab3883 100644 --- a/program/include/rcube_output_html.php +++ b/program/include/rcube_output_html.php @@ -77,6 +77,9 @@ class rcube_output_html extends rcube_output $this->set_skin($skin); $this->set_env('skin', $skin); + if (!empty($_REQUEST['_extwin'])) + $this->set_env('extwin', 1); + // add common javascripts $this->add_script('var '.rcmail::JS_OBJECT_NAME.' = new rcube_webmail();', 'head_top'); @@ -274,6 +277,8 @@ class rcube_output_html extends rcube_output */ public function redirect($p = array(), $delay = 1) { + if ($this->env['extwin']) + $p['extwin'] = 1; $location = $this->app->url($p); header('Location: ' . $location); exit; @@ -974,7 +979,7 @@ class rcube_output_html extends rcube_output else if (in_array($attrib['command'], $a_static_commands)) { $attrib['href'] = $this->app->url(array('action' => $attrib['command'])); } - else if ($attrib['command'] == 'permaurl' && !empty($this->env['permaurl'])) { + else if (($attrib['command'] == 'permaurl' || $attrib['command'] == 'extwin') && !empty($this->env['permaurl'])) { $attrib['href'] = $this->env['permaurl']; } } @@ -1319,6 +1324,10 @@ class rcube_output_html extends rcube_output $hiddenfield = new html_hiddenfield(array('name' => '_framed', 'value' => '1')); $hidden = $hiddenfield->show(); } + if ($this->env['extwin']) { + $hiddenfield = new html_hiddenfield(array('name' => '_extwin', 'value' => '1')); + $hidden = $hiddenfield->show(); + } if (!$content) $attrib['noclose'] = true; |