From 0f042b064a4bdbf2937b24607ba99b99ac02d052 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 5 May 2020 21:49:48 +0000 Subject: [PATCH] Fix warning, notice and DB Error --- src/Database/PostUpdate.php | 2 +- src/Protocol/OStatus.php | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Database/PostUpdate.php b/src/Database/PostUpdate.php index 514956b22..82cc07c6d 100644 --- a/src/Database/PostUpdate.php +++ b/src/Database/PostUpdate.php @@ -707,7 +707,7 @@ class PostUpdate while ($delivery = DBA::fetch($deliveries)) { $id = $delivery['iid']; unset($delivery['iid']); - DBA::insert('post-delivery-data', $delivery); + DBA::insert('post-delivery-data', $delivery, true); ++$rows; } DBA::close($deliveries); diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 9b75e5d12..07465c522 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -2073,7 +2073,8 @@ class OStatus } // uri-id isn't present for follow entry pseudo-items - foreach (Tag::getByURIId($item['uri-id'] ?? 0) as $tag) { + $tags = Tag::getByURIId($item['uri-id'] ?? 0); + foreach ($tags as $tag) { $mentioned[$tag['url']] = $tag['url']; } @@ -2123,11 +2124,9 @@ class OStatus XML::addElement($doc, $entry, "mastodon:scope", "public"); } - if (count($tags)) { - foreach ($tags as $tag) { - if ($tag['type'] == Tag::HASHTAG) { - XML::addElement($doc, $entry, "category", "", ["term" => $tag['name']]); - } + foreach ($tags as $tag) { + if ($tag['type'] == Tag::HASHTAG) { + XML::addElement($doc, $entry, "category", "", ["term" => $tag['name']]); } }