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 9f10c26 commit 6fa6b9a
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 @@ -21,6 +21,7 @@
- Fixed `Phalcon\Db\Dialect\Mysql` and `Phalcon\Db\Dialect\Postresql` to correctly check schema in missing methods
- Fixed `Phalcon\Cache\Backend\Apc::flush` to remove only it's own keys by prefix [#12153](https://github.com/phalcon/cphalcon/issues/12153)
- Fixed `Phalcon\Acl\Adapter\Memory::isAllowed` to call closures when using wildcard [#12333](https://github.com/phalcon/cphalcon/issues/12333)
- 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)
- Fixed `Phalcon\Cache\Backend\Redis::flush` in order to flush cache correctly
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 6fa6b9a

Please sign in to comment.