From: Michael Date: Mon, 20 Mar 2023 14:19:51 +0000 (+0000) Subject: Delete the attached HTML media on content updates X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9c8ae42c04428e62f6ae1e00f8386541d4a5ebdc;p=friendica.git Delete the attached HTML media on content updates --- diff --git a/mod/item.php b/mod/item.php index 77cfc4795a..3e4de2abaf 100644 --- a/mod/item.php +++ b/mod/item.php @@ -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 = [ diff --git a/src/Model/Item.php b/src/Model/Item.php index 12184a3a55..5ef488b977 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -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']); diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index e740fcb17a..f96bb196c2 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -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);