From 4b2ee284d8b5e4e8fd6193678b005670719557bc Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Sat, 18 Feb 2023 10:07:08 -0500 Subject: [PATCH] Change check for friendica-title key to use isa and always set --- src/Module/Api/Mastodon/Statuses.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Module/Api/Mastodon/Statuses.php b/src/Module/Api/Mastodon/Statuses.php index 6020870254..38eeb877c6 100644 --- a/src/Module/Api/Mastodon/Statuses.php +++ b/src/Module/Api/Mastodon/Statuses.php @@ -209,13 +209,10 @@ class Statuses extends BaseApi $item['quote-uri-id'] = $request['quote_id']; } - $has_title = array_key_exists('title', $request['friendica']); - if ($has_title != null && !$request['in_reply_to_id']) { - $item['title'] = $request['friendica']['title']; - } + $item['title'] = $request['friendica']['title'] ?? ''; if (!empty($request['spoiler_text'])) { - if (!$has_title && !$request['in_reply_to_id'] && DI::pConfig()->get($uid, 'system', 'api_spoiler_title', true)) { + if (!isset($request['friendica']['title']) && !$request['in_reply_to_id'] && DI::pConfig()->get($uid, 'system', 'api_spoiler_title', true)) { $item['title'] = $request['spoiler_text']; } else { $item['body'] = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $request['spoiler_text'] . "[/abstract]\n" . $item['body'];