aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-11 14:58:40 +0000
committerMario <mario@mariovavti.com>2022-09-11 14:58:40 +0000
commit480862d7143f291658b48e785eda2e61a438a74b (patch)
tree29661e5f26e4ca5b1e9aff1e8875485157a057d3 /include/feedutils.php
parent990a3af2a7349e07c10224cf2a023d179ecfd6ca (diff)
downloadvolse-hubzilla-480862d7143f291658b48e785eda2e61a438a74b.tar.gz
volse-hubzilla-480862d7143f291658b48e785eda2e61a438a74b.tar.bz2
volse-hubzilla-480862d7143f291658b48e785eda2e61a438a74b.zip
php8: fix more warnings
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 734018922..33bacc2bb 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -270,18 +270,17 @@ function get_atom_author($feed, $item) {
$found_author = $item->get_author();
if($found_author) {
- /// @FIXME $rawauthor is undefined here
+ $rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
+ hz_syslog('rawauthor: ' . print_r($rawauthor, true));
+
if($rawauthor) {
- if($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data'])
+ if(isset($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']))
$author['full_name'] = unxmlify($rawauthor[0]['child'][NAMESPACE_POCO]['displayName'][0]['data']);
}
+
$author['author_name'] = unxmlify($found_author->get_name());
$author['author_link'] = unxmlify($found_author->get_link());
$author['author_is_feed'] = false;
-
- $rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10, 'author');
- //logger('rawauthor: ' . print_r($rawauthor, true));
-
}
else {
$author['author_name'] = unxmlify($feed->get_title());
@@ -497,6 +496,7 @@ function get_atom_elements($feed, $item) {
$res['verb'] = unxmlify($rawverb[0]['data']);
}
+ $ostatus_conversation = '';
$rawcnv = $item->get_item_tags(NAMESPACE_OSTATUS, 'conversation');
if($rawcnv) {
// new style
@@ -1434,9 +1434,9 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
if($author['author_link'] != $contact['xchan_url']) {
$name = '';
- if($author['full_name']) {
+ if(isset($author['full_name'])) {
$name = $author['full_name'];
- if($author['author_name'])
+ if(isset($author['author_name']))
$name .= ' (' . $author['author_name'] . ')';
}
else {
@@ -1468,8 +1468,8 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
// Update content if 'updated' changes
if($r) {
- if(activity_match($datarray['verb'],ACTIVITY_DELETE)
- && $datarray['author_xchan'] === $r[0]['author_xchan']) {
+ if(isset($datarray['verb']) && activity_match($datarray['verb'], ACTIVITY_DELETE)
+ && isset($datarray['author_xchan']) && $datarray['author_xchan'] === $r[0]['author_xchan']) {
if(! intval($r[0]['item_deleted'])) {
logger('deleting item ' . $r[0]['id'] . ' mid=' . $datarray['mid'], LOGGER_DEBUG);
drop_item($r[0]['id'],false);
@@ -1498,11 +1498,11 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$datarray['uid'] = $importer['channel_id'];
$datarray['aid'] = $importer['channel_account_id'];
- if(! link_compare($author['owner_link'], $contact['xchan_url'])) {
+ if(isset($author['owner_link']) && !link_compare($author['owner_link'], $contact['xchan_url'])) {
logger('Correcting item owner.', LOGGER_DEBUG);
- $author['owner_name'] = $contact['name'];
- $author['owner_link'] = $contact['url'];
- $author['owner_avatar'] = $contact['thumb'];
+ $author['owner_name'] = $contact['xchan_name'];
+ $author['owner_link'] = $contact['xchan_url'];
+ $author['owner_avatar'] = $contact['xchan_photo_m'];
}
if($importer['channel_system']) {