diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index acc7afeb5e..9f6d3bcde9 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -285,8 +285,7 @@ class Status extends BaseFactory { if (empty($item['quote-uri-id'])) { $media = Post\Media::getByURIId($item['uri-id'], [Post\Media::ACTIVITY]); - if (!empty($media)) { - $shared_item = Post::selectFirst(['uri-id'], ['plink' => $media[0]['url'], 'uid' => [$uid, 0]]); + if (!empty($media) && $shared_item = Post::selectFirst(['uri-id'], ['plink' => $media[0]['url'], 'uid' => [$uid, 0]])) { $quote_id = $shared_item['uri-id']; } } else { diff --git a/src/Module/Photo.php b/src/Module/Photo.php index bb7ee60297..7a952de407 100644 --- a/src/Module/Photo.php +++ b/src/Module/Photo.php @@ -351,7 +351,7 @@ class Photo extends BaseModule } // If it is a local link, we save resources by just redirecting to it. - if (Network::isLocalLink($url)) { + if (!empty($url) && Network::isLocalLink($url)) { System::externalRedirect($url); }