aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.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/conversation.php
parent96535ee4df967f04d4cc6c3b7f9ab335a50f543d (diff)
downloadvolse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.tar.gz
volse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.tar.bz2
volse-hubzilla-1d56b9a1bb155d7a0b4377f9bb1e195230e545e4.zip
php8: warning fixes
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 7df7b62c2..5f6bc1654 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -106,7 +106,7 @@ function localize_item(&$item){
$author_link = get_rel_link($obj['author']['link'],'alternate');
elseif(isset($obj['actor']) && isset($obj['actor']['url']))
$author_link = ((is_array($obj['actor']['url'])) ? $obj['actor']['url'][0]['href'] : $obj['actor']['url']);
- elseif (is_string($obj['actor']))
+ elseif (isset($obj['actor']) && is_string($obj['actor']))
$author_link = $obj['actor'];
else
$author_link = '';
@@ -116,7 +116,7 @@ function localize_item(&$item){
if(!$author_name)
$author_name = $obj['actor']['name'] ?? '';
- if(!$author_name && is_string($obj['actor'])) {
+ if(!$author_name && isset($obj['actor']) && is_string($obj['actor'])) {
$cached_actor = Activity::get_cached_actor($obj['actor']);
if (is_array($cached_actor)) {
$author_name = $cached_actor['name'] ?? $cached_actor['preferredUsername'];
@@ -691,7 +691,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
];
call_hooks('stream_item',$x);
- if($x['item']['blocked'])
+ if(isset($x['item']['blocked']) && $x['item']['blocked'])
continue;
$item = $x['item'];
@@ -964,14 +964,12 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
function best_link_url($item) {
-
- $best_url = '';
+ $best_url = $item['author-link'] ?? $item['url'] ?? '';
$sparkle = false;
-
$clean_url = isset($item['author-link']) ? normalise_link($item['author-link']) : '';
- if((local_channel()) && (local_channel() == $item['uid'])) {
- if(isset(App::$contacts) && x(App::$contacts,$clean_url)) {
+ if($clean_url && local_channel() && (local_channel() == $item['uid'])) {
+ if(isset(App::$contacts) && x(App::$contacts, $clean_url)) {
if(App::$contacts[$clean_url]['network'] === NETWORK_DFRN) {
$best_url = z_root() . '/redir/' . App::$contacts[$clean_url]['id'];
$sparkle = true;
@@ -980,12 +978,6 @@ function best_link_url($item) {
$best_url = App::$contacts[$clean_url]['url'];
}
}
- if(! $best_url) {
- if($item['author-link'])
- $best_url = $item['author-link'];
- else
- $best_url = $item['url'];
- }
return $best_url;
}