-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Documented the detectCorrupted and corruptedMessage options #6433
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ of the documentation on this constraint. | |
| | - `allowSquare`_ | | ||
| | - `allowLandscape`_ | | ||
| | - `allowPortrait`_ | | ||
| | - `detectCorrupted`_ | | ||
| | - `mimeTypesMessage`_ | | ||
| | - `sizeNotDetectedMessage`_ | | ||
| | - `maxWidthMessage`_ | | ||
|
@@ -35,6 +36,7 @@ of the documentation on this constraint. | |
| | - `allowSquareMessage`_ | | ||
| | - `allowLandscapeMessage`_ | | ||
| | - `allowPortraitMessage`_ | | ||
| | - `corruptedMessage`_ | | ||
| | - See :doc:`File </reference/constraints/File>` for inherited options | | ||
+----------------+-----------------------------------------------------------------------+ | ||
| Class | :class:`Symfony\\Component\\Validator\\Constraints\\Image` | | ||
|
@@ -311,6 +313,18 @@ allowPortrait | |
|
||
If this option is false, the image cannot be portrait oriented. | ||
|
||
detectCorrupted | ||
~~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 3.1 | ||
The ``detectCorrupted`` option was introduced in Symfony 3.1. | ||
|
||
**type**: ``Boolean`` **default**: ``false`` | ||
|
||
If this option is true, the image contents are validated to ensure that the | ||
image is not corrupted. This validation is done with PHP's ``imagecreatefromstring()`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's use the |
||
function, which requires the PHP GD extension to be enabled. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we link to the GD Extension? |
||
|
||
sizeNotDetectedMessage | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
|
@@ -392,4 +406,15 @@ Portrait oriented images are not allowed`` | |
|
||
The error message if the image is portrait oriented and you set `allowPortrait`_ to ``false``. | ||
|
||
corruptedMessage | ||
~~~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 3.1 | ||
The ``corruptedMessage`` option was introduced in Symfony 3.1. | ||
|
||
**type**: ``string`` **default**: ``The image file is corrupted.`` | ||
|
||
The error message if the image contents are corrupted and you set `detectCorrupted`_ | ||
to ``true``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would change the order:
|
||
|
||
.. _`IANA website`: http://www.iana.org/assignments/media-types/image/index.html |
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.
boolean