Skip to content

Commit

Permalink
Merge pull request #4571 from iRedds/fix/validation-with-request
Browse files Browse the repository at this point in the history
Fix: Validation::withRequest() with Content-Type: multipart/form-data
  • Loading branch information
samsonasik authored Apr 15, 2021
2 parents 91d2916 + 4c11abd commit 5cf1d72
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion system/Validation/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ public function withRequest(RequestInterface $request): ValidationInterface
return $this;
}

if (in_array($request->getMethod(), ['put', 'patch', 'delete'], true))
if (in_array($request->getMethod(), ['put', 'patch', 'delete'], true)
&& strpos($request->getHeaderLine('Content-Type'), 'multipart/form-data') === false
)
{
$this->data = $request->getRawInput();
}
Expand Down

0 comments on commit 5cf1d72

Please sign in to comment.