From: Hank Grabowski <hankgrabowski@gmail.com>
Date: Sun, 19 Mar 2023 03:05:49 +0000 (-0400)
Subject: Fix posting/editing empty text image posts through Mastodon API
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4366737eb826fa34b9537bd37ade08a5c97c227c;p=friendica.git

Fix posting/editing empty text image posts through Mastodon API
---

diff --git a/src/Model/Item.php b/src/Model/Item.php
index 93ad4fd8f0..12184a3a55 100644
--- a/src/Model/Item.php
+++ b/src/Model/Item.php
@@ -589,7 +589,7 @@ class Item
 	public static function isValid(array $item): bool
 	{
 		// When there is no content then we don't post it
-		if (($item['body'] . $item['title'] == '') && empty($item['quote-uri-id']) && (empty($item['uri-id']) || !Post\Media::existsByURIId($item['uri-id']))) {
+		if (($item['body'] . $item['title'] == '') && empty($item['quote-uri-id']) && empty($item['attachments']) && (empty($item['uri-id']) || !Post\Media::existsByURIId($item['uri-id']))) {
 			Logger::notice('No body, no title.');
 			return false;
 		}