diff --git a/src/Controller/Upload.php b/src/Controller/Upload.php index 2a9f086..a01cb62 100644 --- a/src/Controller/Upload.php +++ b/src/Controller/Upload.php @@ -99,6 +99,11 @@ public function handleUpload(Request $request): JsonResponse try { /** @var File $result */ $result = $uploadHandler->process($request->files->get('file')); + + // Clear the 'files' from the superglobals. We do this, so that we prevent breakage + // later on, should we do a `Request::createFromGlobals();` + // @see: https://github.com/bolt/core/issues/2027 + $_FILES = []; } catch (\Throwable $e) { return new JsonResponse([ 'error' => true,