aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-06-02 11:34:08 +0000
committerMario <mario@mariovavti.com>2023-06-02 11:34:08 +0000
commit0e8d1afcaff6cff815c85ee4034da11a2967aee3 (patch)
tree6e74a7e3790d3bf05c8cacc35b1a29d65df63f0f
parent48a33f08e2042b0bb809f43f9bec9d7739af3c28 (diff)
parentf9ca9565108f528c8397b422573923a661f73480 (diff)
downloadvolse-hubzilla-0e8d1afcaff6cff815c85ee4034da11a2967aee3.tar.gz
volse-hubzilla-0e8d1afcaff6cff815c85ee4034da11a2967aee3.tar.bz2
volse-hubzilla-0e8d1afcaff6cff815c85ee4034da11a2967aee3.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r--include/text.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/text.php b/include/text.php
index aadca80e1..2693e7b16 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1543,7 +1543,6 @@ function link_compare($a, $b) {
function theme_attachments(&$item) {
-
$s = '';
$arr = json_decode($item['attach'],true);
@@ -1557,15 +1556,25 @@ function theme_attachments(&$item) {
$label = '';
- if(isset($r['title']))
+ if(isset($r['name'])) {
+ $label = urldecode(htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8'));
+ }
+
+ if(! $label && isset($r['title'])) {
$label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8'));
+ }
- if(! $label && isset($r['href']))
- $label = basename($r['href']);
+ if(!$label && isset($r['href'])) {
+ $m = parse_url($r['href']);
+ if ($m && $m['path']) {
+ $label = basename($m['path']);
+ }
+ }
//some feeds provide an attachment where title an empty space
- if(! $label || $label == ' ')
- $label = t('Unknown Attachment');
+ if(!trim($label)) {
+ $label = t('Unknown attachment');
+ }
$title = t('Size') . ' ' . (isset($r['length']) ? userReadableSize($r['length']) : t('unknown'));
@@ -1594,7 +1603,6 @@ function theme_attachments(&$item) {
return $s;
}
-
function format_categories(&$item,$writeable) {
$s = '';