Skip to content

Commit

Permalink
Fixed phalcon#14198: Missing validation value resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
CameronHall committed Jun 23, 2019
1 parent 5a32421 commit 9fa404d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
- Fixed `Phalcon\Mvc\Router` now parses and uses path. [#14087](https://github.com/phalcon/cphalcon/issues/14087)
- Fixed various areas in `Phalcon\Acl\Adapter` and `Phalcon\Acl\Adapter\Memory` including comments, logic, `denyComponentAccess` and `AdapterInterface`. Added tests. [#13870](https://github.com/phalcon/cphalcon/issues/13870)
- Fixed `Phalcon\Config::merge()` not merging numeric values properly [#13201](https://github.com/phalcon/cphalcon/issues/13201), [#13768](https://github.com/phalcon/cphalcon/issues/13768)
- Fixed `Phalcon\Validation\Validator\File\AbstractFile` missing the resolution of the `value` property [#14198](https://github.com/phalcon/cphalcon/issues/14198)

## Removed
- Removed `Phalcon\Session\Factory`. [#13672](https://github.com/phalcon/cphalcon/issues/13672)
Expand Down
4 changes: 4 additions & 0 deletions phalcon/Validation/Validator/File/FileAbstract.zep
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ abstract class FileAbstract extends Validator
{
var label, replacePairs, value;

let value = validation->getValue(field);

if !isset value["error"] || !isset value["tmp_name"] || value["error"] !== UPLOAD_ERR_OK || !is_uploaded_file(value["tmp_name"]) {
let label = this->prepareLabel(validation, field),
replacePairs = [
Expand Down Expand Up @@ -185,6 +187,8 @@ abstract class FileAbstract extends Validator
{
var label, replacePairs, value;

let value = validation->getValue(field);

if !isset value["name"] || !isset value["type"] || !isset value["size"] {
let label = this->prepareLabel(validation, field),
replacePairs = [
Expand Down

0 comments on commit 9fa404d

Please sign in to comment.