]> _ Git - cubist_cms-back.git/commitdiff
wip #4791 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Oct 2021 14:10:38 +0000 (16:10 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Oct 2021 14:10:38 +0000 (16:10 +0200)
src/app/Magic/Controllers/CubistMagicController.php

index 271ffbe7f43c54ae6cdc0dc4f6f66e538b9f5807..e7d86556f01238aeac73ca797d43b395e526e2f9 100644 (file)
@@ -358,11 +358,13 @@ class CubistMagicController extends CubistCrudController
     {
         $entry = $this->crud->getEntry($id);
         /** @var Media $media */
-        $e = explode('.', $_FILES['file']['name']);
+        $file = request()->files->get('file');
+        $e = explode('.', $file['name']);
         $ext = array_pop($e);
         $fname = implode('.', $e);
         $fname = Str::slug($fname);
-        $_FILES['file']['name'] = $fname . '.' . $ext;
+        $file['name'] = $fname . '.' . $ext;
+        request()->files->set('file', $file);
 
         $media = $entry->addMediaFromRequest('file')->toMediaCollection($request->input('collection'));