Skip to content

[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

Merged
merged 1 commit into from
Jun 16, 2014

Conversation

megazoll
Copy link
Contributor

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.';
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@Tobion
Copy link
Contributor

Tobion commented Jun 16, 2014

👍

2 similar comments
@fabpot
Copy link
Member

fabpot commented Jun 16, 2014

👍

@stof
Copy link
Member

stof commented Jun 16, 2014

👍

@fabpot
Copy link
Member

fabpot commented Jun 16, 2014

Thank you @megazoll.

@fabpot fabpot merged commit 1b253cb into symfony:master Jun 16, 2014
fabpot added a commit that referenced this pull request Jun 16, 2014
…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
weaverryan added a commit to symfony/symfony-docs that referenced this pull request Jul 3, 2014
…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
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.

4 participants