aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-05-20 20:19:11 -0700
committerzotlabs <mike@macgirvin.com>2018-05-20 20:19:11 -0700
commit0044906fabbfeb837326982bbc8d3fcc64b47fa8 (patch)
treeaa855fe68a468626b15f9b954c000680bb405b0b /include/text.php
parentac8706e919d62a3a487fe3776e03160454ca8992 (diff)
parent469809183d232761b8984848c133f9f11f5e7cea (diff)
downloadvolse-hubzilla-0044906fabbfeb837326982bbc8d3fcc64b47fa8.tar.gz
volse-hubzilla-0044906fabbfeb837326982bbc8d3fcc64b47fa8.tar.bz2
volse-hubzilla-0044906fabbfeb837326982bbc8d3fcc64b47fa8.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index ef3c8871c..aafba2168 100644
--- a/include/text.php
+++ b/include/text.php
@@ -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'));