From 158ebc56ef4e415d117fa403db292333c298eef4 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 14 Oct 2021 16:10:38 +0200 Subject: [PATCH] wip #4791 @0:10 --- src/app/Magic/Controllers/CubistMagicController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/Magic/Controllers/CubistMagicController.php b/src/app/Magic/Controllers/CubistMagicController.php index 271ffbe..e7d8655 100644 --- a/src/app/Magic/Controllers/CubistMagicController.php +++ b/src/app/Magic/Controllers/CubistMagicController.php @@ -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')); -- 2.39.5