]> git.mxchange.org Git - friendica.git/commitdiff
Check the edit date before storing history
authorMichael <heluecht@pirati.ca>
Sun, 15 May 2022 21:15:31 +0000 (21:15 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 15 May 2022 21:15:31 +0000 (21:15 +0000)
src/Model/Post/History.php

index 68f2e9cda67f34f80db3236115fbfbb428c5a848..24ee7c1e7d13bea850e12b6f91d07a04cd21eb95 100644 (file)
@@ -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;
                }