Verified Commit a0606d24 authored by Jess's avatar Jess
Browse files

SA-CORE-2024-002 by prudloff, catch, larowlan, benjifisher, kim.pepper, wim leers, xjm

parent 301c19da
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -143,8 +143,11 @@ public static function create(ContainerInterface $container) {
   */
  public function upload(Request $request): Response {
    // Getting the UploadedFile directly from the request.
    /** @var \Symfony\Component\HttpFoundation\File\UploadedFile $upload */
    /** @var \Symfony\Component\HttpFoundation\File\UploadedFile|null $upload */
    $upload = $request->files->get('upload');
    if ($upload === NULL || !$upload->isValid()) {
      throw new HttpException(500, $upload?->getErrorMessage() ?: 'Invalid file upload');
    }
    $filename = $upload->getClientOriginalName();

    /** @var \Drupal\editor\EditorInterface $editor */