diff options
author | Mario <mario@mariovavti.com> | 2022-09-08 20:02:22 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-09-08 20:02:22 +0000 |
commit | 990a3af2a7349e07c10224cf2a023d179ecfd6ca (patch) | |
tree | 75c6f7bcb2f7d630a3fc5395e7f3480541e4fe25 /include/text.php | |
parent | 1f5a23143aa5aa1fb3273b8a9c74782cd0441fde (diff) | |
download | volse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.tar.gz volse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.tar.bz2 volse-hubzilla-990a3af2a7349e07c10224cf2a023d179ecfd6ca.zip |
php8: random cleanup and warning fixes
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/text.php b/include/text.php index 0c806d009..87aaf7bf8 100644 --- a/include/text.php +++ b/include/text.php @@ -1554,6 +1554,8 @@ function theme_attachments(&$item) { if(isset($r['type'])) $icon = getIconFromType($r['type']); + $label = ''; + if(isset($r['title'])) $label = urldecode(htmlspecialchars($r['title'], ENT_COMPAT, 'UTF-8')); @@ -1593,7 +1595,7 @@ function theme_attachments(&$item) { function format_categories(&$item,$writeable) { $s = ''; - $terms = get_terms_oftype($item['term'],TERM_CATEGORY); + $terms = isset($item['term']) ? get_terms_oftype($item['term'], TERM_CATEGORY) : []; if($terms) { $categories = array(); foreach($terms as $t) { @@ -1623,7 +1625,7 @@ function format_categories(&$item,$writeable) { function format_hashtags(&$item) { $s = ''; - $terms = get_terms_oftype($item['term'], array(TERM_HASHTAG,TERM_COMMUNITYTAG)); + $terms = isset($item['term']) ? get_terms_oftype($item['term'], array(TERM_HASHTAG, TERM_COMMUNITYTAG)) : []; if($terms) { foreach($terms as $t) { $term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ; @@ -1647,7 +1649,7 @@ function format_hashtags(&$item) { function format_mentions(&$item) { $s = ''; - $terms = get_terms_oftype($item['term'],TERM_MENTION); + $terms = isset($item['term']) ? get_terms_oftype($item['term'], TERM_MENTION) : []; if($terms) { foreach($terms as $t) { if(! isset($t['term'])) @@ -1670,7 +1672,7 @@ function format_mentions(&$item) { function format_filer(&$item) { $s = ''; - $terms = get_terms_oftype($item['term'],TERM_FILE); + $terms = isset($item['term']) ? get_terms_oftype($item['term'], TERM_FILE) : []; if($terms) { $categories = array(); foreach($terms as $t) { @@ -1789,14 +1791,15 @@ function prepare_body(&$item,$attach = false,$opts = false) { $s = $poll; } - $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : false); + $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : []); $prep_arr = [ 'item' => $item, 'html' => $event ? $event['content'] : $s, - 'event' => $event['header'], + 'event' => $event ? $event['header'] : '', 'photo' => $photo ]; + /** * @hooks prepare_body * * \e array \b item @@ -1827,6 +1830,7 @@ function prepare_body(&$item,$attach = false,$opts = false) { $tags = format_hashtags($item); + $mentions = ''; if($item['resource_type'] == 'photo') $mentions = format_mentions($item); |