]> git.mxchange.org Git - friendica.git/commitdiff
Delete the attached HTML media on content updates
authorMichael <heluecht@pirati.ca>
Mon, 20 Mar 2023 14:19:51 +0000 (14:19 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 20 Mar 2023 14:19:51 +0000 (14:19 +0000)
mod/item.php
src/Model/Item.php
src/Protocol/ActivityPub/Processor.php

index 77cfc4795a755b301e622e802e1766340903da97..3e4de2abafe329bc54e17744cc3b14be8b9d31f7 100644 (file)
@@ -106,7 +106,7 @@ function item_edit(int $uid, array $request, bool $preview, string $return_path)
        $post['edit'] = $post;
        $post['file'] = Post\Category::getTextByURIId($post['uri-id'], $post['uid']);   
 
-       Post\Media::deleteByURIId($post['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::IMAGE]);
+       Post\Media::deleteByURIId($post['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::IMAGE, Post\Media::HTML]);
        $post = item_process($post, $request, $preview, $return_path);
 
        $fields = [
index 12184a3a55d69de9ea00861b971af5278754aecf..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']);
index e740fcb17a5449525b232cfdf8e0dbd3e95ef9a9..f96bb196c22f35acbc7ac860d83f9434c2b3117c 100644 (file)
@@ -244,7 +244,7 @@ class Processor
                $item['changed'] = DateTimeFormat::utcNow();
                $item['edited'] = DateTimeFormat::utc($activity['updated']);
 
-               Post\Media::deleteByURIId($item['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::IMAGE]);
+               Post\Media::deleteByURIId($item['uri-id'], [Post\Media::AUDIO, Post\Media::VIDEO, Post\Media::IMAGE, Post\Media::HTML]);
                $item = self::processContent($activity, $item);
                if (empty($item)) {
                        Queue::remove($activity);