summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc12
-rw-r--r--program/steps/mail/get.inc7
-rw-r--r--program/steps/mail/show.inc5
3 files changed, 14 insertions, 10 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 1e5dbda19..5a18ded6b 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -947,7 +947,7 @@ function rcmail_message_headers($attrib, $headers=NULL)
// single header value is requested
if (!empty($attrib['valueof']))
- return Q($plugin['output'][$attrib['valueof']]['value'], ($hkey == 'subject' ? 'strict' : 'show'));
+ return Q($plugin['output'][$attrib['valueof']]['value'], ($attrib['valueof'] == 'subject' ? 'strict' : 'show'));
// compose html table
$table = new html_table(array('cols' => 2));
@@ -1477,13 +1477,13 @@ function rcmail_draftinfo_decode($str)
function rcmail_message_part_controls($attrib)
{
- global $MESSAGE;
+ global $MESSAGE, $RCMAIL;
$part = asciiwords(get_input_value('_part', RCUBE_INPUT_GPC));
if (!is_object($MESSAGE) || !is_array($MESSAGE->parts) || !($_GET['_uid'] && $_GET['_part']) || !$MESSAGE->mime_parts[$part])
return '';
- $part = $MESSAGE->mime_parts[$part];
+ $part = $MESSAGE->mime_parts[$part];
$table = new html_table(array('cols' => 3));
$filename = $part->filename;
@@ -1497,10 +1497,8 @@ function rcmail_message_part_controls($attrib)
$table->add('download-link', html::a(array('href' => './?'.str_replace('_frame=', '_download=', $_SERVER['QUERY_STRING'])), Q(rcube_label('download'))));
}
- if (!empty($part->size)) {
- $table->add('title', Q(rcube_label('filesize')));
- $table->add('header', Q(show_bytes($part->size)));
- }
+ $table->add('title', Q(rcube_label('filesize')));
+ $table->add('header', Q($RCMAIL->message_part_size($part)));
return $table->show($attrib);
}
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 658538a20..bcd57dee0 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -199,13 +199,18 @@ else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) {
$sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout);
}
}
+ // send part as-it-is
else {
- // turn off output buffering and print part content
if ($part->body) {
+ header("Content-Length: " . sizeof($part->body));
echo $part->body;
$sent = true;
}
else if ($part->size) {
+ if ($size = (int)$part->d_parameters['size']) {
+ header("Content-Length: $size");
+ }
+
$sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
}
}
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 158ba31c8..5fa72d77f 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -144,7 +144,7 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) {
function rcmail_message_attachments($attrib)
{
- global $PRINT_MODE, $MESSAGE;
+ global $PRINT_MODE, $MESSAGE, $RCMAIL;
$out = $ol = '';
@@ -156,7 +156,8 @@ function rcmail_message_attachments($attrib)
}
if ($PRINT_MODE) {
- $ol .= html::tag('li', null, sprintf("%s (%s)", Q($filename), Q(show_bytes($attach_prop->size))));
+ $size = $RCMAIL->message_part_size($attach_prop);
+ $ol .= html::tag('li', null, Q(sprintf("%s (%s)", $filename, $size)));
}
else {
if (mb_strlen($filename) > 50) {