From 12e530775b76727145acf5893f24961e2e72d262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ma=CC=88nnig=20=28move=3Aelevator=29?= Date: Wed, 14 Dec 2022 16:21:51 +0100 Subject: [PATCH] Merge body with files in multipart validation instead of replace. So I can used files and text data in the same request part --- src/PSR7/Validators/BodyValidator/MultipartValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PSR7/Validators/BodyValidator/MultipartValidator.php b/src/PSR7/Validators/BodyValidator/MultipartValidator.php index b7f13b71..211c642b 100644 --- a/src/PSR7/Validators/BodyValidator/MultipartValidator.php +++ b/src/PSR7/Validators/BodyValidator/MultipartValidator.php @@ -28,7 +28,7 @@ use Riverline\MultiPartParser\StreamedPart; use RuntimeException; -use function array_replace; +use function array_merge_recursive; use function in_array; use function is_array; use function json_decode; @@ -235,7 +235,7 @@ private function validateServerRequestMultipart( $files = $this->normalizeFiles($message->getUploadedFiles()); - $body = array_replace($body, $files); + $body = array_merge_recursive($body, $files); $validator = new SchemaValidator($this->detectValidationStrategy($message)); try {