Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Commit

Permalink
Merge pull request #14 from magento-engcom/MAGETWO-89875
Browse files Browse the repository at this point in the history
MAGETWO-89875: null passed to count() call in Zend/Validate/File/Uplo…
  • Loading branch information
Joan He committed Mar 30, 2018
2 parents d99ca64 + 34a90a1 commit 10d8c93
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 21 deletions.
6 changes: 1 addition & 5 deletions library/Zend/Validate/File/FilesSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ public function isValid($value, $file = null)
}
}

if (count($this->_messages) > 0) {
return false;
}

return true;
return !empty($this->_messages);
}
}
6 changes: 1 addition & 5 deletions library/Zend/Validate/File/ImageSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,7 @@ public function isValid($value, $file = null)
$this->_throw($file, self::HEIGHT_TOO_BIG);
}

if (count($this->_messages) > 0) {
return false;
}

return true;
return !empty($this->_messages);
}

/**
Expand Down
6 changes: 1 addition & 5 deletions library/Zend/Validate/File/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,7 @@ public function isValid($value, $file = null)
}
}

if (count($this->_messages) > 0) {
return false;
}

return true;
return !empty($this->_messages);
}

/**
Expand Down
8 changes: 2 additions & 6 deletions library/Zend/Validate/File/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function setFiles($files = array())
*/
public function isValid($value, $file = null)
{
$this->_messages = null;
$this->_messages = [];
if (array_key_exists($value, $this->_files)) {
$files[$value] = $this->_files[$value];
} else {
Expand Down Expand Up @@ -223,11 +223,7 @@ public function isValid($value, $file = null)
}
}

if (count($this->_messages) > 0) {
return false;
} else {
return true;
}
return !empty($this->_messages);
}

/**
Expand Down

0 comments on commit 10d8c93

Please sign in to comment.