]> git.mxchange.org Git - friendica.git/commitdiff
Fix warning, notice and DB Error
authorMichael <heluecht@pirati.ca>
Tue, 5 May 2020 21:49:48 +0000 (21:49 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 5 May 2020 21:49:48 +0000 (21:49 +0000)
src/Database/PostUpdate.php
src/Protocol/OStatus.php

index 514956b222b5630a944061c7264099058494e907..82cc07c6d6d7a5ed1550d097b850b80bf5ad4a92 100644 (file)
@@ -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);
index 9b75e5d12bef059d1e612efa127bfce4b4b26732..07465c522a183718efdabd86f5319bdf94623a5f 100644 (file)
@@ -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']]);
                        }
                }