fix issues with attachment labels
This commit is contained in:
parent
6abbadf6c8
commit
0bc2a4f603
@ -1415,15 +1415,21 @@ function unobscure_mail(&$item) {
|
|||||||
function theme_attachments(&$item) {
|
function theme_attachments(&$item) {
|
||||||
|
|
||||||
$arr = json_decode($item['attach'],true);
|
$arr = json_decode($item['attach'],true);
|
||||||
|
|
||||||
if(is_array($arr) && count($arr)) {
|
if(is_array($arr) && count($arr)) {
|
||||||
$attaches = array();
|
$attaches = array();
|
||||||
foreach($arr as $r) {
|
foreach($arr as $r) {
|
||||||
|
|
||||||
$icon = getIconFromType($r['type']);
|
$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
|
//some feeds provide an attachment where title an empty space
|
||||||
if($label == ' ')
|
if(! $label || $label == ' ')
|
||||||
$label = t('Unknown Attachment');
|
$label = t('Unknown Attachment');
|
||||||
|
|
||||||
$title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));
|
$title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));
|
||||||
|
Reference in New Issue
Block a user