Skip to content

Commit

Permalink
Fix displaying size of attachments with zero size
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Sep 10, 2016
1 parent e0cedf0 commit 650ac8b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
4 changes: 4 additions & 0 deletions program/include/rcmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions program/steps/mail/show.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 650ac8b

Please sign in to comment.