fix issues with attachment labels

This commit is contained in:
Mario Vavti 2018-05-19 11:04:34 +02:00
parent 6abbadf6c8
commit 0bc2a4f603

View File

@ -1415,15 +1415,21 @@ function unobscure_mail(&$item) {
function theme_attachments(&$item) {
$arr = json_decode($item['attach'],true);
if(is_array($arr) && count($arr)) {
$attaches = array();
foreach($arr as $r) {
$icon = getIconFromType($r['type']);
$label = (($r['title']) ? urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')) : t('Unknown Attachment'));
if($r['title'])
$label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8'));
if(! $label && $r['href'])
$label = basename($r['href']);
//some feeds provide an attachment where title an empty space
if($label == ' ')
if(! $label || $label == ' ')
$label = t('Unknown Attachment');
$title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));