From 2306261ab2962e8e160f36a9785fd6ff98c874f2 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 16 May 2024 12:24:34 +0000 Subject: [PATCH] Tumblr: "isLocalLink" is now "isLocalUrl" / Bluesky: Fix for an empty uri --- bluesky/bluesky.php | 4 ++++ tumblr/tumblr.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index ed2a8496..ba7c1d65 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -1506,6 +1506,10 @@ function bluesky_fetch_missing_post(string $uri, int $uid, int $fetch_uid, int $ } $class = bluesky_get_uri_class($uri); + if (empty($class)) { + return $fallback; + } + $fetch_uri = $class->uri; Logger::debug('Fetch missing post', ['level' => $level, 'uid' => $uid, 'uri' => $uri]); diff --git a/tumblr/tumblr.php b/tumblr/tumblr.php index 78e415ee..04f6a0a4 100644 --- a/tumblr/tumblr.php +++ b/tumblr/tumblr.php @@ -614,7 +614,7 @@ function tumblr_send_legacy(array $b) $params['data'] = []; foreach ($media as $photo) { if ($photo['type'] == Post\Media::IMAGE) { - if (Network::isLocalLink($photo['url']) && ($data = Photo::getResourceData($photo['url']))) { + if (DI::baseUrl()->isLocalUrl($photo['url']) && ($data = Photo::getResourceData($photo['url']))) { $photo = Photo::selectFirst([], ["`resource-id` = ? AND `scale` > ?", $data['guid'], 0]); if (!empty($photo)) { $params['data'][] = Photo::getImageDataForPhoto($photo); -- 2.43.5