\Drupal\file\Upload\FileUploadHandler::handleFileUpload() should alway check that the uploaded file is valid

Created on 2 April 2024, 9 months ago
Updated 29 April 2024, 8 months ago

Problem/Motivation

In ๐Ÿ“Œ Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface RTBC we added a flag and deprecated the code path that called $uploaded_file->isValid(). This was a mistake because it places the onus on callers to ensure that the uploaded file information is valid.

We have even got this wrong in core already - compare the code in file_save_upload() and \Drupal\ckeditor5\Controller\CKEditor5ImageController::upload().

Proposed resolution

On 11.x revert ๐Ÿ“Œ PP-1: Removed deprecated code in File module (core/module/file) Postponed and then in this issue rework ๐Ÿ“Œ Create an UploadedFile validator and deprecate error checking methods on UploadedFileInterface RTBC to ensure that we do the uplaoded file validation in \Drupal\file\Upload\FileUploadHandler::handleFileUpload()

Remaining tasks

User interface changes

None

API changes

TBD
Will definitely revert some deprecations.

Data model changes

None

Release notes snippet

TBD

๐Ÿ› Bug report
Status

Fixed

Version

10.3 โœจ

Component
File systemย  โ†’

Last updated about 4 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom alexpott ๐Ÿ‡ช๐Ÿ‡บ๐ŸŒ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024