diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ba49de99e7..994631731f6 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/phalcon/validation/validator/file.zep b/phalcon/validation/validator/file.zep index 746929a1683..660b6c9a647 100644 --- a/phalcon/validation/validator/file.zep +++ b/phalcon/validation/validator/file.zep @@ -97,7 +97,9 @@ class File extends Validator */ public function validate( 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"); @@ -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; @@ -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"),