Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Allow FlowUploadedFile coming from HTTP requests #1747

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion Neos.Flow/Classes/Mvc/ActionRequest.php
Expand Up @@ -12,6 +12,7 @@
*/

use Neos\Flow\Annotations as Flow;
use Neos\Http\Factories\FlowUploadedFile;
use Psr\Http\Message\ServerRequestInterface as HttpRequestInterface;
use Neos\Flow\ObjectManagement\Exception\UnknownObjectException;
use Neos\Flow\ObjectManagement\ObjectManagerInterface;
Expand Down Expand Up @@ -523,7 +524,8 @@ public function setArgument(string $argumentName, $value): void
return;
}

if (is_object($value)) {
// Allowing FlowUploadedFile because that already comes from the HTTP request.
if (is_object($value) && !($value instanceof FlowUploadedFile)) {
throw new Exception\InvalidArgumentTypeException('You are not allowed to store objects in the request arguments. Please convert the object of type "' . get_class($value) . '" given for argument "' . $argumentName . '" to a simple type first.', 1302783022);
}

Expand Down