2022-03-28 22:39:48.000000000 +0530 2022-03-28 22:39:58.000000000 +0530 @@ -1,8 +1,8 @@ diff --git a/core/modules/file/file.module b/core/modules/file/file.module -index f17b773d8c..32cfc8188f 100644 +index 7300dd9c67..60940d7a38 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module -@@ -32,6 +32,8 @@ +@@ -33,6 +33,8 @@ use Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException; use Symfony\Component\HttpFoundation\File\Exception\NoFileException; use Symfony\Component\HttpFoundation\File\Exception\PartialFileException; @@ -11,7 +11,7 @@ use Symfony\Component\Mime\MimeTypeGuesserInterface; /** -@@ -940,16 +942,36 @@ function file_save_upload($form_field_name, $validators = [], $destination = FAL +@@ -868,16 +870,36 @@ function file_save_upload($form_field_name, $validators = [], $destination = FAL '%file' => $uploaded_file->getFilename(), '%maxsize' => format_size(Environment::getUploadMaxSize()), ])); @@ -48,7 +48,7 @@ $files[$i] = FALSE; } catch (FileValidationException $e) { -@@ -970,7 +992,7 @@ function file_save_upload($form_field_name, $validators = [], $destination = FAL +@@ -898,7 +920,7 @@ function file_save_upload($form_field_name, $validators = [], $destination = FAL } catch (FileWriteException $e) { \Drupal::messenger()->addError(t('File upload error. Could not move uploaded file.')); @@ -58,12 +58,12 @@ } catch (FileException $e) { diff --git a/core/modules/file/tests/src/Kernel/FileUploadHandlerTest.php b/core/modules/file/tests/src/Kernel/FileUploadHandlerTest.php -index 5c8fb7fb0b..8f809f9d76 100644 +index c5f3362c8e..b72b77947d 100644 --- a/core/modules/file/tests/src/Kernel/FileUploadHandlerTest.php +++ b/core/modules/file/tests/src/Kernel/FileUploadHandlerTest.php -@@ -4,7 +4,13 @@ - +@@ -5,7 +5,14 @@ use Drupal\Component\Utility\Environment; + use Drupal\file\Upload\UploadedFileInterface; use Drupal\KernelTests\KernelTestBase; +use Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException; +use Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException; @@ -72,10 +72,11 @@ +use Symfony\Component\HttpFoundation\File\Exception\NoFileException; +use Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException; +use Symfony\Component\HttpFoundation\File\Exception\PartialFileException; - use Symfony\Component\HttpFoundation\File\UploadedFile; ++use Symfony\Component\HttpFoundation\File\UploadedFile; /** -@@ -17,7 +23,7 @@ class FileUploadHandlerTest extends KernelTestBase { + * Tests the file upload handler. +@@ -17,7 +24,7 @@ class FileUploadHandlerTest extends KernelTestBase { /** * {@inheritdoc} */ @@ -84,7 +85,7 @@ /** * The file upload handler under test. -@@ -48,4 +54,77 @@ public function testFileSaveUploadSingleErrorFormSize() { +@@ -48,4 +55,77 @@ public function testFileSaveUploadSingleErrorFormSize() { $this->fileUploadHandler->handleFileUpload($file_info); }