Return early if link is missing from share block in Model\Item
- Address https://github.com/friendica/friendica/issues/7998#issuecomment-594992869
This commit is contained in:
parent
1afb49f412
commit
e6e4baa872
|
@ -3873,6 +3873,10 @@ class Item
|
||||||
// first try to fetch the item via the GUID. This will work for all reshares that had been created on this system
|
// first try to fetch the item via the GUID. This will work for all reshares that had been created on this system
|
||||||
$shared_item = self::selectFirst(['title', 'body', 'attach'], ['guid' => $shared['guid'], 'uid' => [0, $uid]]);
|
$shared_item = self::selectFirst(['title', 'body', 'attach'], ['guid' => $shared['guid'], 'uid' => [0, $uid]]);
|
||||||
if (!DBA::isResult($shared_item)) {
|
if (!DBA::isResult($shared_item)) {
|
||||||
|
if (empty($shared['link'])) {
|
||||||
|
return $item;
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwhise try to find (and possibly fetch) the item via the link. This should work for Diaspora and ActivityPub posts
|
// Otherwhise try to find (and possibly fetch) the item via the link. This should work for Diaspora and ActivityPub posts
|
||||||
$id = self::fetchByLink($shared['link'], $uid);
|
$id = self::fetchByLink($shared['link'], $uid);
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
|
|
Loading…
Reference in a new issue