[Embed] Fix some bugs and change AttachmentEmbed::url to ::media_url

This commit is contained in:
2021-05-01 22:45:47 +01:00
committed by Hugo Sales
parent c9090e6cee
commit 1c9f807595
3 changed files with 100 additions and 100 deletions

View File

@@ -48,7 +48,7 @@ class GSFile
// The following properly gets the mimetype with `file` or other
// available methods, so should be safe
$mimetype = $sfile->getMimeType();
Event::handle('AttachmentValidation', [&$sfile, &$mimetype, &$title]);
Event::handle('AttachmentValidation', [&$sfile, &$mimetype, &$title, &$width, &$height]);
$attachment = Attachment::create([
'file_hash' => $hash,
'gsactor_id' => $actor_id,
@@ -57,6 +57,8 @@ class GSFile
'filename' => $hash,
'is_local' => $is_local,
'size' => $sfile->getSize(),
'width' => $width,
'height' => $height,
]);
$sfile->move($dest_dir, $hash);
DB::persist($attachment);