]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Merge pull request #12920 from annando/issue-12701
[friendica.git] / src / Model / Item.php
index 93ad4fd8f0db787e7306b492185ad1f5fd2e0b80..5ef488b9777109309915cbe49591781187544663 100644 (file)
@@ -201,8 +201,6 @@ class Item
                $notify_items = [];
 
                while ($item = DBA::fetch($items)) {
-                       Post\Media::deleteByURIId($item['uri-id'], [Post\Media::HTML]);
-
                        if (!empty($fields['body'])) {
                                if (!empty($item['quote-uri-id'])) {
                                        $fields['body'] = BBCode::removeSharedData($fields['body']);
@@ -589,7 +587,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;
                }