Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurigag committed Oct 23, 2016
1 parent 4b43799 commit 0ac380f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fixed `Phalcon\Session\Adapter\Libmemcached::read`, `Phalcon\Session\Adapter\Libmemcached::destroy`, `Phalcon\Session\Adapter\Memcache::read`, `Phalcon\Session\Adapter\Memcache::destroy`, `Phalcon\Session\Adapter\Redis::read` and `Phalcon\Session\Adapter\Redis::destroy` in accordance with the `session_set_save_handler` API [#12206](https://github.com/phalcon/cphalcon/pull/12206)
- Fixed `Phalcon\Validation::getValue()` to use filters when having entity
- Fixed `Phalcon\Db\Dialect\Mysql::describeReferences()` and `Phalcon\Db\Dialect\Postgresql::describeReferences()` to return proper sql
- Fixed `Phalcon\Validation\Validator\File` array to string conversion in `minResolution` and `maxResolution` [#12349](https://github.com/phalcon/cphalcon/issues/12349)


# [3.0.1](https://github.com/phalcon/cphalcon/releases/tag/v3.0.1) (2016-08-24)
Expand Down
16 changes: 9 additions & 7 deletions phalcon/validation/validator/file.zep
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ class File extends Validator
*/
public function validate(<Validation> validation, string! field) -> boolean
{
var value, message, label, replacePairs, types, byteUnits, unit, maxSize, matches, bytes, mime, tmp, width, height, minResolution, maxResolution, minWidth, maxWidth, minHeight, maxHeight, fieldTypes, code;
var value, message, label, replacePairs, types, byteUnits, unit, maxSize, matches, bytes, mime, tmp, width,
height, minResolution, maxResolution, minWidth, maxWidth, minHeight, maxHeight, fieldTypes, code,
minResolutionArray, maxResolutionArray;

let value = validation->getValue(field),
label = this->getOption("label");
Expand Down Expand Up @@ -251,9 +253,9 @@ class File extends Validator
if typeof minResolution == "array" {
let minResolution = minResolution[field];
}
let minResolution = explode("x", minResolution),
minWidth = minResolution[0],
minHeight = minResolution[1];
let minResolutionArray = explode("x", minResolution),
minWidth = minResolutionArray[0],
minHeight = minResolutionArray[1];
} else {
let minWidth = 1,
minHeight = 1;
Expand Down Expand Up @@ -281,9 +283,9 @@ class File extends Validator
if typeof maxResolution == "array" {
let maxResolution = maxResolution[field];
}
let maxResolution = explode("x", maxResolution),
maxWidth = maxResolution[0],
maxHeight = maxResolution[1];
let maxResolutionArray = explode("x", maxResolution),
maxWidth = maxResolutionArray[0],
maxHeight = maxResolutionArray[1];

if width > maxWidth || height > maxHeight {
let message = this->getOption("messageMaxResolution"),
Expand Down

0 comments on commit 0ac380f

Please sign in to comment.