diff options
author | Andrew Manning <tamanning@zoho.com> | 2018-05-24 05:35:50 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2018-05-24 05:35:50 -0400 |
commit | fc6b337bbbd2fd3b5412c8b957122830f73feb2d (patch) | |
tree | e8417e561ac7445a4018c0cf3bf722779493c430 /include/text.php | |
parent | 40d99c171678654817e392b7f59050dccce770a8 (diff) | |
parent | 9cf8931136c703c66d0bf83e4c6b8fb7f4d2cf0b (diff) | |
download | volse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.tar.gz volse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.tar.bz2 volse-hubzilla-fc6b337bbbd2fd3b5412c8b957122830f73feb2d.zip |
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php index ef3c8871c..34063cdd7 100644 --- a/include/text.php +++ b/include/text.php @@ -572,7 +572,7 @@ function item_message_id() { $r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1", dbesc($mid)); - if(count($r)) + if($r) $dups = true; } while($dups == true); @@ -593,7 +593,7 @@ function photo_new_resource() { $r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1", dbesc($resource)); - if(count($r)) + if($r) $found = true; } while($found === true); @@ -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')); |