aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2021-04-18 21:25:32 +0200
committerMax Kostikov <max@kostikov.co>2021-04-18 21:25:32 +0200
commitcd97c32444b617331aca135529b568374b9117e7 (patch)
treeff118e60e4054ba27880667e1724f7bb7c04f34f /include/feedutils.php
parentd2f1edfad841a186b796e7d468bd1454f6c19f68 (diff)
downloadvolse-hubzilla-cd97c32444b617331aca135529b568374b9117e7.tar.gz
volse-hubzilla-cd97c32444b617331aca135529b568374b9117e7.tar.bz2
volse-hubzilla-cd97c32444b617331aca135529b568374b9117e7.zip
more PHP 8 fixes
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 6cae14a01..e827bde98 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -324,7 +324,7 @@ function get_atom_author($feed, $item) {
// check for a yahoo media element (github etc.)
- if(! $author['author_photo']) {
+ if(! x($author,'author_photo') || ! $author['author_photo']) {
$rawmedia = $item->get_item_tags(NAMESPACE_YMEDIA,'thumbnail');
if($rawmedia && $rawmedia[0]['attribs']['']['url']) {
$author['author_photo'] = strip_tags(unxmlify($rawmedia[0]['attribs']['']['url']));
@@ -334,7 +334,7 @@ function get_atom_author($feed, $item) {
// No photo/profile-link on the item - look at the feed level
- if((! (x($author,'author_link'))) || (! (x($author,'author_photo')))) {
+ if(! x($author,'author_link') || ! x($author,'author_photo')) {
$rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author');
if($rawauthor && $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) {
$base = $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'];
@@ -478,13 +478,13 @@ function get_atom_elements($feed, $item) {
if($rawedited)
$res['edited'] = unxmlify($rawedited[0]['data']);
- if((x($res,'edited')) && (! (x($res,'created'))))
+ if(x($res,'edited') && ! x($res,'created'))
$res['created'] = $res['edited'];
- if(! $res['created'])
+ if(! x($res,'created'))
$res['created'] = $item->get_date('c');
- if(! $res['edited'])
+ if(! x($res,'edited'))
$res['edited'] = $item->get_date('c');
$rawverb = $item->get_item_tags(NAMESPACE_ACTIVITY, 'verb');
@@ -509,7 +509,7 @@ function get_atom_elements($feed, $item) {
}
}
- $ostatus_protocol = (($ostatus_conversation || $res['verb']) ? true : false);
+ $ostatus_protocol = ($ostatus_conversation || (x($res,'verb') && $res['verb']) ? true : false);
$mastodon = (($item->get_item_tags('http://mastodon.social/schema/1.0','scope')) ? true : false);
if($mastodon) {
@@ -1113,7 +1113,8 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$parent_link = $rawthread[0]['attribs']['']['href'];
}
- logger('in-reply-to: ' . $parent_mid, LOGGER_DEBUG);
+ if(isset($parent_mid))
+ logger('in-reply-to: ' . $parent_mid, LOGGER_DEBUG);
if($is_reply) {
@@ -1408,7 +1409,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
// if we have everything but a photo, provide the default profile photo
- if($author['author_name'] && $author['author_link'] && (! $author['author_photo']))
+ if($author['author_name'] && $author['author_link'] && (! x($author,'author_photo') || ! $author['author_photo']))
$author['author_photo'] = z_root() . '/' . get_default_profile_photo(80);
if(is_array($contact)) {