diff --git a/CHANGELOG b/CHANGELOG index 45f26c24cbb..cc49206d203 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -54,6 +54,7 @@ CHANGELOG Roundcube Webmail - Fix PHP warning when handling shared namespace with empty prefix (#5420) - Fix so folders list is scrolled to the selected folder on page load (#5424) - Fix so when moving to Trash we make sure the folder exists (#5192) +- Fix displaying size of attachments with zero size RELEASE 1.2.1 ------------- diff --git a/program/include/rcmail.php b/program/include/rcmail.php index c2007c7d76f..fc6ea575d30 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -2350,6 +2350,10 @@ public function message_part_size($part) else { $size = $part->size; + if ($size === 0) { + $part->exact_size = true; + } + if ($part->encoding == 'base64') { $size = $size / 1.33; } diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index de54eb4a6f2..e1909a4d966 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -202,10 +202,7 @@ function rcmail_message_attachments($attrib) $title = ''; } - if ($attach_prop->size) { - $size = ' ' . html::span('attachment-size', '(' . rcube::Q($filesize) . ')'); - } - + $size = ' ' . html::span('attachment-size', '(' . rcube::Q($filesize) . ')'); $mimetype = rcmail_fix_mimetype($attach_prop->mimetype); $class = rcube_utils::file2class($mimetype, $filename); $id = 'attach' . $attach_prop->mime_id;