Merge pull request #9530 from annando/fatal

Fix fatal errors
This commit is contained in:
Hypolite Petovan 2020-11-12 07:57:53 -05:00 committed by GitHub
commit 6dee10f340
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 19 deletions

View file

@ -995,10 +995,18 @@ class Transmitter
if (!empty($author['nurl'])) {
$self = Contact::selectFirst(['uid'], ['nurl' => $author['nurl'], 'self' => true]);
if (!empty($self['uid'])) {
$item = Item::selectFirst([], ['uri-id' => $item['uri-id'], 'uid' => $self['uid']]);
$forum_item = Item::selectFirst([], ['uri-id' => $item['uri-id'], 'uid' => $self['uid']]);
if (DBA::isResult($item)) {
$item = $forum_item;
}
}
}
}
if (empty($item['uri-id'])) {
Logger::warning('Item without uri-id', ['item' => $item]);
return false;
}
if (empty($type)) {
$condition = ['item-uri' => $item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB];

View file

@ -552,6 +552,7 @@ class Feed
$data = PageInfo::queryUrl($item["plink"], false, $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_denylist"] ?? '');
if (!empty($data)) {
// Take the data that was provided by the feed if the query is empty
if (($data['type'] == 'link') && empty($data['title']) && empty($data['text'])) {
$data['title'] = $saved_title;
@ -571,6 +572,7 @@ class Feed
$taglist = $contact["fetch_further_information"] == 2 ? PageInfo::getTagsFromUrl($item["plink"], $preview, $contact["ffi_keyword_denylist"] ?? '') : [];
$item["object-type"] = Activity\ObjectType::BOOKMARK;
$attachments = [];
}
} else {
if (!empty($summary)) {
$item["body"] = '[abstract]' . HTML::toBBCode($summary, $basepath) . "[/abstract]\n" . $item["body"];