1
0
Fork 0
forked from mirror/pixelfed

Update ApiV1Controller, fix null caption on media bug

This commit is contained in:
Daniel Supernault 2024-10-05 20:45:32 -06:00
parent 9b8e7ff628
commit 424f0271c3
No known key found for this signature in database
GPG key ID: 23740873EE6F76A1
2 changed files with 4 additions and 3 deletions

View file

@ -1878,7 +1878,7 @@ class ApiV1Controller extends Controller
$media->original_sha256 = $hash;
$media->size = $photo->getSize();
$media->mime = $mime;
$media->caption = $request->input('description');
$media->caption = $request->input('description') ?? "";
$media->filter_class = $filterClass;
$media->filter_name = $filterName;
if ($license) {
@ -2106,7 +2106,7 @@ class ApiV1Controller extends Controller
$media->original_sha256 = $hash;
$media->size = $photo->getSize();
$media->mime = $mime;
$media->caption = $request->input('description');
$media->caption = $request->input('description') ?? "";
$media->filter_class = $filterClass;
$media->filter_name = $filterName;
if ($license) {

View file

@ -119,10 +119,11 @@ class ComposeController extends Controller
$media->media_path = $path;
$media->original_sha256 = $hash;
$media->size = $photo->getSize();
$media->caption = "";
$media->mime = $mime;
$media->filter_class = $filterClass;
$media->filter_name = $filterName;
$media->version = 3;
$media->version = '3';
$media->save();
$preview_url = $media->url().'?v='.time();