From 916c51c6305c8e885e2827c5607c09e42bbafbbc Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 17 May 2021 19:20:31 +0000 Subject: [PATCH] Fix fatal errors / added some API todo --- doc/API-Mastodon.md | 1 + src/Model/Item.php | 2 +- src/Protocol/DFRN.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/API-Mastodon.md b/doc/API-Mastodon.md index 480e81cc48..3f21d823a4 100644 --- a/doc/API-Mastodon.md +++ b/doc/API-Mastodon.md @@ -122,6 +122,7 @@ These emdpoints are planned to be implemented - [`POST /api/v1/conversations/:id/read`](https://docs.joinmastodon.org/methods/timelines/conversations/) - [`GET /api/v1/instance/activity`](https://docs.joinmastodon.org/methods/instance#weekly-activity) - [`GET /api/v1/timelines/direct`](https://docs.joinmastodon.org/methods/timelines/) +- [`GET /api/v2/search`](https://docs.joinmastodon.org/methods/search/) ## Non supportable endpoints diff --git a/src/Model/Item.php b/src/Model/Item.php index d937430c39..e8044ecd7a 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2707,7 +2707,7 @@ class Item $shared_links = []; } - $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'], $shared_links); + $attachments = Post\Media::splitAttachments($item['uri-id'], $item['guid'] ?? '', $shared_links); $s = self::addVisualAttachments($attachments, $item, $s, false); $s = self::addLinkAttachment($attachments, $body, $s, false, $shared_links); $s = self::addNonVisualAttachments($attachments, $item, $s, false); diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 2cb83627ac..194fa43fdd 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -899,7 +899,7 @@ class DFRN $entry->setAttribute("xmlns:statusnet", ActivityNamespace::STATUSNET); } - $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body']); + $body = Post\Media::addAttachmentsToBody($item['uri-id'], $item['body'] ?? ''); if ($item['private'] == Item::PRIVATE) { $body = Item::fixPrivatePhotos($body, $owner['uid'], $item, $cid);