|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
| program/steps/mail/viewsource.inc |
|
|
|
|
|
| |
|
|
|
|
|
| This file is part of the Roundcube Webmail client |
|
|
|
|
|
| Copyright (C) 2005-2013, The Roundcube Dev Team |
|
|
|
|
|
| Copyright (C) 2005-2016, The Roundcube Dev Team |
|
|
|
|
|
| |
|
|
|
|
|
| Licensed under the GNU General Public License version 3 or |
|
|
|
|
|
| any later version with exceptions for skins & plugins. |
|
|
|
|
@ -27,7 +27,15 @@ ob_end_clean();
|
|
|
|
|
|
|
|
|
|
// similar code as in program/steps/mail/get.inc
|
|
|
|
|
if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)) {
|
|
|
|
|
if ($pos = strpos($uid, '.')) {
|
|
|
|
|
$message = new rcube_message($uid);
|
|
|
|
|
$headers = $message->headers;
|
|
|
|
|
$part_id = substr($uid, $pos + 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$headers = $RCMAIL->storage->get_message_headers($uid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$charset = $headers->charset ?: $RCMAIL->config->get('default_charset');
|
|
|
|
|
|
|
|
|
|
header("Content-Type: text/plain; charset={$charset}");
|
|
|
|
@ -46,7 +54,12 @@ if ($uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET)) {
|
|
|
|
|
header("Content-Disposition: attachment; filename=\"$filename\"");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($message)) {
|
|
|
|
|
$message->get_part_body($part_id, empty($_GET['_save']), 0, -1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$RCMAIL->storage->print_raw_body($uid, empty($_GET['_save']));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
rcube::raise_error(array(
|
|
|
|
|