From cbb9cb6c242f90919c623b50562ef7a788404f62 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Feb 2023 21:02:59 +0000 Subject: [PATCH 1/2] Fix v1 endpoint --- src/Object/Api/Mastodon/Instance.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 5459694e6a..08df62c0f0 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -84,14 +84,14 @@ class Instance extends BaseDataTransferObject { $register_policy = intval($config->get('config', 'register_policy')); - $this->uri = $baseUrl; + $this->uri = $baseUrl->getHost(); $this->title = $config->get('config', 'sitename'); $this->short_description = $this->description = $config->get('config', 'info'); $this->email = implode(',', User::getAdminEmailList()); $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); - $this->thumbnail = $baseUrl . 'images/friendica-banner.jpg'; + $this->thumbnail = $baseUrl->__toString() . '/images/friendica-banner.jpg'; $this->languages = [$config->get('system', 'language')]; $this->max_toot_chars = (int)$config->get('config', 'api_import_size', $config->get('config', 'max_import_size')); $this->registrations = ($register_policy != Register::CLOSED); From a5b774d2efa562742b6a16e0564b127ec29263db Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 27 Feb 2023 21:15:11 +0000 Subject: [PATCH 2/2] Without "->__toString()" --- src/Object/Api/Mastodon/Instance.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Object/Api/Mastodon/Instance.php b/src/Object/Api/Mastodon/Instance.php index 08df62c0f0..118d491fc9 100644 --- a/src/Object/Api/Mastodon/Instance.php +++ b/src/Object/Api/Mastodon/Instance.php @@ -91,7 +91,7 @@ class Instance extends BaseDataTransferObject $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')'; $this->urls = null; // Not supported $this->stats = new Stats($config, $database); - $this->thumbnail = $baseUrl->__toString() . '/images/friendica-banner.jpg'; + $this->thumbnail = $baseUrl . '/images/friendica-banner.jpg'; $this->languages = [$config->get('system', 'language')]; $this->max_toot_chars = (int)$config->get('config', 'api_import_size', $config->get('config', 'max_import_size')); $this->registrations = ($register_policy != Register::CLOSED);