Skip to content
Permalink
Browse files

Merge pull request #199 from satelines/master

fix corner cases in ImageValidator
  • Loading branch information...
flack committed Apr 5, 2019
2 parents 7a24529 + 12c7a94 commit 86bed6650c7212d92a2b7d789de261fb8097596e
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/midcom/datamanager/validation/imageValidator.php
@@ -12,9 +12,10 @@ class imageValidator extends ConstraintValidator
{
public function validate($value, Constraint $constraint)
{
if ( !empty($value['delete'])
if ( empty($value)
|| !empty($value['delete'])
|| ( empty($value['file'])
&& ( empty($constraint->config['do_not_save_archival'] && empty($value['archival']))
&& ( empty($constraint->config['do_not_save_archival']) && empty($value['archival'])
xor empty($value['main'])))) {
$this->context->buildViolation('This value should not be blank.')
->addViolation();

0 comments on commit 86bed66

Please sign in to comment.
You can’t perform that action at this time.