Avoid endless loop when storing posts

This commit is contained in:
Michael 2022-05-10 06:07:26 +00:00
parent d195d934be
commit 7c3173a0ae

View File

@ -1442,7 +1442,7 @@ class Item
return 0; return 0;
} }
if ((($item['gravity'] == GRAVITY_COMMENT) || $is_reshare) && !Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $uid])) { if (($uri_id != $item['thr-parent-id']) && (($item['gravity'] == GRAVITY_COMMENT) || $is_reshare) && !Post::exists(['uri-id' => $item['thr-parent-id'], 'uid' => $uid])) {
// Fetch the origin user for the post // Fetch the origin user for the post
$origin_uid = self::GetOriginUidForUriId($item['thr-parent-id'], $uid); $origin_uid = self::GetOriginUidForUriId($item['thr-parent-id'], $uid);
if (is_null($origin_uid)) { if (is_null($origin_uid)) {