Update Helpers.php

This commit is contained in:
Daniel Supernault 2024-12-23 02:05:15 -07:00
parent 1d2f76c8e5
commit 8c39ef449a
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1

View file

@ -689,13 +689,14 @@ class Helpers
return $option['replies']['totalItems'] ?? 0; return $option['replies']['totalItems'] ?? 0;
})->toArray(); })->toArray();
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
$status = new Status; $status = new Status;
$status->profile_id = $profile->id; $status->profile_id = $profile->id;
$status->url = isset($res['url']) ? $res['url'] : $url; $status->url = isset($res['url']) ? $res['url'] : $url;
$status->uri = isset($res['url']) ? $res['url'] : $url; $status->uri = isset($res['url']) ? $res['url'] : $url;
$status->object_url = $id; $status->object_url = $id;
$status->caption = strip_tags(Purify::clean($res['content'])) ?? ""; $status->caption = strip_tags(Purify::clean($res['content'])) ?? $defaultCaption;
$status->rendered = ""; $status->rendered = $defaultCaption;
$status->created_at = Carbon::parse($ts)->tz('UTC'); $status->created_at = Carbon::parse($ts)->tz('UTC');
$status->in_reply_to_id = null; $status->in_reply_to_id = null;
$status->local = false; $status->local = false;