Prevent the use of $shared_item if it's falsy in Mastodon\Status::createQuote
- Address https://github.com/friendica/friendica/issues/12488#issuecomment-1407342324
This commit is contained in:
parent
6dfa492521
commit
9a270de9c2
1 changed files with 1 additions and 2 deletions
|
@ -285,8 +285,7 @@ class Status extends BaseFactory
|
||||||
{
|
{
|
||||||
if (empty($item['quote-uri-id'])) {
|
if (empty($item['quote-uri-id'])) {
|
||||||
$media = Post\Media::getByURIId($item['uri-id'], [Post\Media::ACTIVITY]);
|
$media = Post\Media::getByURIId($item['uri-id'], [Post\Media::ACTIVITY]);
|
||||||
if (!empty($media)) {
|
if (!empty($media) && $shared_item = Post::selectFirst(['uri-id'], ['plink' => $media[0]['url'], 'uid' => [$uid, 0]])) {
|
||||||
$shared_item = Post::selectFirst(['uri-id'], ['plink' => $media[0]['url'], 'uid' => [$uid, 0]]);
|
|
||||||
$quote_id = $shared_item['uri-id'];
|
$quote_id = $shared_item['uri-id'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue