From 79039ba5957be5f0b87370b5f599badbb9b5b6b8 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 6 Dec 2024 03:15:39 -0700 Subject: [PATCH] Update StatusStatelessTransformer, refactor the caption field to be compliant with the MastoAPI. Fixes #5364 --- app/Services/StatusService.php | 2 +- app/Transformer/Api/StatusStatelessTransformer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/StatusService.php b/app/Services/StatusService.php index 64a434d32..de2f4d112 100644 --- a/app/Services/StatusService.php +++ b/app/Services/StatusService.php @@ -10,7 +10,7 @@ use League\Fractal\Serializer\ArraySerializer; class StatusService { - const CACHE_KEY = 'pf:services:status:v1:'; + const CACHE_KEY = 'pf:services:status:v1.1:'; public static function key($id, $publicOnly = true) { diff --git a/app/Transformer/Api/StatusStatelessTransformer.php b/app/Transformer/Api/StatusStatelessTransformer.php index db454fc9b..9f52ab50a 100644 --- a/app/Transformer/Api/StatusStatelessTransformer.php +++ b/app/Transformer/Api/StatusStatelessTransformer.php @@ -23,7 +23,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract { $taggedPeople = MediaTagService::get($status->id); $poll = $status->type === 'poll' ? PollService::get($status->id) : null; - $rendered = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : null; + $rendered = $status->caption ? nl2br(Autolink::create()->autolink($status->caption)) : ""; return [ '_v' => 1,