1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

Fix bug #47775 - Properly convert and show filesize information

Authorised by: naderman

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9748 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Andreas Fischer
2009-07-11 10:05:20 +00:00
parent dfdb78a027
commit 54ee31972a
5 changed files with 82 additions and 29 deletions

View File

@@ -853,16 +853,14 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
}
}
$filesize = $attachment['filesize'];
$size_lang = ($filesize >= 1048576) ? $user->lang['MIB'] : (($filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
$filesize = get_formatted_filesize($filesize, false);
$filesize = get_formatted_filesize($attachment['filesize'], false);
$comment = bbcode_nl2br(censor_text($attachment['attach_comment']));
$block_array += array(
'UPLOAD_ICON' => $upload_icon,
'FILESIZE' => $filesize,
'SIZE_LANG' => $size_lang,
'FILESIZE' => $filesize['value'],
'SIZE_LANG' => $filesize['unit'],
'DOWNLOAD_NAME' => basename($attachment['real_filename']),
'COMMENT' => $comment,
);