summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/file/file.module
diff options
context:
space:
mode:
authorLee Rowlands <lee.rowlands@previousnext.com.au>2024-04-11 15:42:35 +1000
committerLee Rowlands <lee.rowlands@previousnext.com.au>2024-04-11 15:42:35 +1000
commit79d006640be9a404a620c9414cbe4e7b38cb26a5 (patch)
tree1f12af1680578513cd32e7d2b334548c78fc207d /core/modules/file/file.module
parentc8cfcf07a8efe5fe72ad1e3e5d3cdea712aeb675 (diff)
downloaddrupal-79d006640be9a404a620c9414cbe4e7b38cb26a5.tar.gz
drupal-79d006640be9a404a620c9414cbe4e7b38cb26a5.zip
Issue #3437623 by alexpott, kim.pepper, sakthi_dev: \Drupal\file\Upload\FileUploadHandler::handleFileUpload() should alway check that the uploaded file is valid
Diffstat (limited to 'core/modules/file/file.module')
-rw-r--r--core/modules/file/file.module9
1 files changed, 0 insertions, 9 deletions
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 555b406e2441..bc52dbe021a0 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -653,18 +653,9 @@ function file_save_upload($form_field_name, $validators = [], $destination = FAL
/** @var \Drupal\Core\Render\RendererInterface $renderer */
$renderer = \Drupal::service('renderer');
$files = [];
- /** @var \Drupal\file\Validation\UploadedFileValidatorInterface $uploaded_file_validator */
- $uploaded_file_validator = \Drupal::service('file.uploaded_file_validator');
/** @var \Symfony\Component\HttpFoundation\File\UploadedFile $uploaded_file */
foreach ($uploaded_files as $i => $uploaded_file) {
try {
- $violations = $uploaded_file_validator->validate($uploaded_file);
- if (count($violations) > 0) {
- // We only get one violation for uploaded files.
- \Drupal::messenger()->addError($violations->get(0)->getMessage());
- $files[$i] = FALSE;
- continue;
- }
$form_uploaded_file = new FormUploadedFile($uploaded_file);
$result = $file_upload_handler->handleFileUpload($form_uploaded_file, $validators, $destination, $fileExists, FALSE);
if ($result->hasViolations()) {