aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-14 12:31:19 +0000
committerMario <mario@mariovavti.com>2022-09-14 12:31:19 +0000
commit1d56b9a1bb155d7a0b4377f9bb1e195230e545e4 (patch)
treef7b6413727a97cfa0512dc9701d493d6751dc741 /include/text.php
parent96535ee4df967f04d4cc6c3b7f9ab335a50f543d (diff)
downloadvolse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.tar.gz
volse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.tar.bz2
volse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.zip
php8: warning fixes
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/text.php b/include/text.php
index 63b472bbd..dde810e17 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1544,8 +1544,10 @@ function link_compare($a, $b) {
function theme_attachments(&$item) {
+
$s = '';
$arr = json_decode($item['attach'],true);
+
if(is_array($arr) && count($arr)) {
$attaches = [];
@@ -1568,13 +1570,15 @@ function theme_attachments(&$item) {
$title = t('Size') . ' ' . (isset($r['length']) ? userReadableSize($r['length']) : t('unknown'));
+ $revision = $r['revision'] ?? '';
+
require_once('include/channel.php');
if (isset($r['href'])) {
if(is_foreigner($item['author_xchan']))
$url = $r['href'];
else
- $url = z_root() . '/magic?f=&owa=1&hash=' . $item['author_xchan'] . '&bdest=' . bin2hex($r['href'] . '/' . $r['revision']);
+ $url = z_root() . '/magic?f=&owa=1&hash=' . $item['author_xchan'] . '&bdest=' . bin2hex($r['href'] . '/' . $revision);
}
//$s .= '<a href="' . $url . '" title="' . $title . '" class="attachlink" >' . $icon . '</a>';