]> _ Git - cubist_cms-back.git/commitdiff
done #4791
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Oct 2021 18:46:17 +0000 (20:46 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Oct 2021 18:46:17 +0000 (20:46 +0200)
src/app/Magic/Controllers/CubistMagicController.php

index c40993fbf03cd8d5a9aba6f7b82dcca1a568a3ee..50c1305cbb9410faa4357df7233d806f4aa82c64 100644 (file)
@@ -362,7 +362,7 @@ class CubistMagicController extends CubistCrudController
         /** @var UploadedFile $file */
         $file = request()->files->get('file');
 
-        $nfile = new UploadedFile($file->getPathname(), Str::slug($file->getClientOriginalName()) . '.' . $file->getClientOriginalExtension(), $file->getMimeType(), $file->getError());
+        $nfile = new UploadedFile($file->getPathname(), Str::slug(str_replace('.' . $file->getClientOriginalExtension(), '', $file->getClientOriginalName())) . '.' . $file->getClientOriginalExtension(), $file->getMimeType(), $file->getError());
         request()->files->set('file', $nfile);
 
         $media = $entry->addMediaFromRequest('file')->toMediaCollection($request->input('collection'));