Merge pull request #12919 from annando/html-media-update

Delete the attached HTML media on content updates
This commit is contained in:
Hypolite Petovan 2023-03-20 21:03:12 -04:00 committed by GitHub
commit 5f52981255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 4 deletions

View File

@ -106,7 +106,7 @@ function item_edit(int $uid, array $request, bool $preview, string $return_path)
$post['edit'] = $post; $post['edit'] = $post;
$post['file'] = Post\Category::getTextByURIId($post['uri-id'], $post['uid']); $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); $post = item_process($post, $request, $preview, $return_path);
$fields = [ $fields = [

View File

@ -201,8 +201,6 @@ class Item
$notify_items = []; $notify_items = [];
while ($item = DBA::fetch($items)) { while ($item = DBA::fetch($items)) {
Post\Media::deleteByURIId($item['uri-id'], [Post\Media::HTML]);
if (!empty($fields['body'])) { if (!empty($fields['body'])) {
if (!empty($item['quote-uri-id'])) { if (!empty($item['quote-uri-id'])) {
$fields['body'] = BBCode::removeSharedData($fields['body']); $fields['body'] = BBCode::removeSharedData($fields['body']);

View File

@ -244,7 +244,7 @@ class Processor
$item['changed'] = DateTimeFormat::utcNow(); $item['changed'] = DateTimeFormat::utcNow();
$item['edited'] = DateTimeFormat::utc($activity['updated']); $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); $item = self::processContent($activity, $item);
if (empty($item)) { if (empty($item)) {
Queue::remove($activity); Queue::remove($activity);