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

Fixed an issue with file validation #72

Merged

Conversation

vadymtsots
Copy link
Contributor

This PR fixes an issue with uploaded file validation described here: https://github.com/WendellAdriel/laravel-validated-dto/discussions/63

Before validation, an UploadedFile instance gets casted to array and passed to Validator. Validator performs a instance of UploadedFile check, and the validation fails, because of this cast to array.

The PR adds an additional check to SimpleDTO's isArrayable() method, that ensures that UploadedFile object is not considered arrayable value and it will not be passed to formatArrayableValue() method for further array casting.

Unit tests for file validation were also added.

WendellAdriel
WendellAdriel previously approved these changes Feb 5, 2024
@WendellAdriel
Copy link
Owner

@vadymtsots thanks for the contribution, just fix the code style issues and it's all good to go!

@WendellAdriel
Copy link
Owner

Thanks for the help with this one @vadymtsots!!! 💪

@WendellAdriel WendellAdriel merged commit 32d86fe into WendellAdriel:main Feb 5, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants