-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Disallow empty file in FileValidator #11125
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
Conversation
megazoll
commented
Jun 15, 2014
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | yes |
Deprecations? | no |
Tests pass? | yes |
Fixed tickets | |
License | MIT |
Doc PR | symfony/symfony-docs#3746 |
@@ -29,6 +29,7 @@ class File extends Constraint | |||
public $notReadableMessage = 'The file is not readable.'; | |||
public $maxSizeMessage = 'The file is too large ({{ size }} {{ suffix }}). Allowed maximum size is {{ limit }} {{ suffix }}.'; | |||
public $mimeTypesMessage = 'The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}.'; | |||
public $disallowEmptyMessage = 'Empty file is not allowed.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full sentence please. An empty file is not allowed. Also the problem that the file is opened in another program. Is it unique to Windows? Or is it the same bahavior in other OS and programs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem that the file is opened in another program I can repeat only on Windows. But I can upload file with zero bytes on any OS but that make no sense, that files are useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if the problem with opened file had been in every OS, then we could added a hint to the validation message. But when it's not the case, then it's ok like this.
👍 |
2 similar comments
👍 |
👍 |
Thank you @megazoll. |
…zoll) This PR was merged into the 2.3-dev branch. Discussion ---------- [Validator] Disallow empty file in FileValidator | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#3746 Commits ------- 1b253cb Disallow empty file in FileValidator
…oll) This PR was merged into the master branch. Discussion ---------- [Validator] Disallow empty file in FileValidator | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes (symfony/symfony#11125) | Applies to | 2.6+ Commits ------- 80673d5 Disallow empty file in FileValidator