From: Michael Date: Sun, 15 May 2022 21:15:31 +0000 (+0000) Subject: Check the edit date before storing history X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2c511b8a2388f5633456963f7b3c75b0070866b5;p=friendica.git Check the edit date before storing history --- diff --git a/src/Model/Post/History.php b/src/Model/Post/History.php index 68f2e9cda6..24ee7c1e7d 100644 --- a/src/Model/Post/History.php +++ b/src/Model/Post/History.php @@ -42,6 +42,12 @@ class History $post = Post::selectFirstPost($fields, ['uri-id' => $uri_id]); if (empty($post)) { + Logger::warning('Post not found', ['uri-id' => $uri_id]); + return; + } + + if ($item['edited'] <= $post['edited']) { + Logger::info('New edit date is not newer than the old one', ['uri-id' => $uri_id, 'old' => $post['edited'], 'new' => $item['edited']]); return; }