Merge pull request #11485 from annando/endless-loop

Avoid endless loop when storing posts
This commit is contained in:
Tobias Diekershoff 2022-05-10 08:44:39 +02:00 committed by GitHub
commit 4be52cdc4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1442,7 +1442,7 @@ class Item
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
$origin_uid = self::GetOriginUidForUriId($item['thr-parent-id'], $uid);
if (is_null($origin_uid)) {