mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-10 06:00:45 +00:00
Fix rendered caption
This commit is contained in:
parent
1af73c55fb
commit
85124aa642
5 changed files with 5 additions and 7 deletions
|
@ -3494,7 +3494,7 @@ class ApiV1Controller extends Controller
|
|||
return [];
|
||||
}
|
||||
|
||||
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
|
||||
$defaultCaption = "";
|
||||
$content = $request->filled('status') ? strip_tags($request->input('status')) : $defaultCaption;
|
||||
$cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false);
|
||||
$spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null;
|
||||
|
|
|
@ -1292,7 +1292,7 @@ class ApiV1Dot1Controller extends Controller
|
|||
if ($user->last_active_at == null) {
|
||||
return [];
|
||||
}
|
||||
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
|
||||
$defaultCaption = "";
|
||||
$content = $request->filled('status') ? strip_tags(Purify::clean($request->input('status'))) : $defaultCaption;
|
||||
$cw = $user->profile->cw == true ? true : $request->boolean('sensitive', false);
|
||||
$spoilerText = $cw && $request->filled('spoiler_text') ? $request->input('spoiler_text') : null;
|
||||
|
|
|
@ -55,14 +55,12 @@ class CommentController extends Controller
|
|||
}
|
||||
|
||||
$reply = DB::transaction(function () use ($comment, $status, $profile, $nsfw) {
|
||||
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
|
||||
|
||||
$scope = $profile->is_private == true ? 'private' : 'public';
|
||||
$reply = new Status;
|
||||
$reply->profile_id = $profile->id;
|
||||
$reply->is_nsfw = $nsfw;
|
||||
$reply->caption = Purify::clean($comment);
|
||||
$reply->rendered = $defaultCaption;
|
||||
$reply->rendered = "";
|
||||
$reply->in_reply_to_id = $status->id;
|
||||
$reply->in_reply_to_profile_id = $status->profile_id;
|
||||
$reply->scope = $scope;
|
||||
|
|
|
@ -570,7 +570,7 @@ class ComposeController extends Controller
|
|||
$status->cw_summary = $request->input('spoiler_text');
|
||||
}
|
||||
|
||||
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
|
||||
$defaultCaption = "";
|
||||
$status->caption = strip_tags($request->input('caption')) ?? $defaultCaption;
|
||||
$status->rendered = $defaultCaption;
|
||||
$status->scope = 'draft';
|
||||
|
|
|
@ -689,7 +689,7 @@ class Helpers
|
|||
return $option['replies']['totalItems'] ?? 0;
|
||||
})->toArray();
|
||||
|
||||
$defaultCaption = config_cache('database.default') === 'mysql' ? null : "";
|
||||
$defaultCaption = "";
|
||||
$status = new Status;
|
||||
$status->profile_id = $profile->id;
|
||||
$status->url = isset($res['url']) ? $res['url'] : $url;
|
||||
|
|
Loading…
Reference in a new issue