]> git.mxchange.org Git - friendica.git/commitdiff
Change check for friendica-title key to use isa and always set
authorHank Grabowski <hankgrabowski@gmail.com>
Sat, 18 Feb 2023 15:07:08 +0000 (10:07 -0500)
committerHank Grabowski <hankgrabowski@gmail.com>
Sat, 18 Feb 2023 15:07:08 +0000 (10:07 -0500)
src/Module/Api/Mastodon/Statuses.php

index 60208702543a82698dfbdc7506f99373ae89c76f..38eeb877c6b4e9e6db63cc201807550213e1ff54 100644 (file)
@@ -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'];