From 11c78cb4fbb675038de9bdfda68c50e490f4b253 Mon Sep 17 00:00:00 2001 From: Gudz Taras Date: Tue, 5 Nov 2013 06:15:42 +0400 Subject: [PATCH] Changed validateFile() method access from protected to public, fixed hasErrors check --- framework/yii/validators/FileValidator.php | 2 +- framework/yii/validators/ImageValidator.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/yii/validators/FileValidator.php b/framework/yii/validators/FileValidator.php index 179a897999..4726c6cb9f 100644 --- a/framework/yii/validators/FileValidator.php +++ b/framework/yii/validators/FileValidator.php @@ -168,7 +168,7 @@ class FileValidator extends Validator * @param string $attribute the attribute being validated * @param UploadedFile $file uploaded file passed to check against a set of rules */ - protected function validateFile($object, $attribute, $file) + public function validateFile($object, $attribute, $file) { switch ($file->error) { case UPLOAD_ERR_OK: diff --git a/framework/yii/validators/ImageValidator.php b/framework/yii/validators/ImageValidator.php index 1ed2517c3e..a60cc93315 100644 --- a/framework/yii/validators/ImageValidator.php +++ b/framework/yii/validators/ImageValidator.php @@ -145,11 +145,11 @@ class ImageValidator extends FileValidator * @param string $attribute the attribute being validated * @param UploadedFile $file uploaded file passed to check against a set of rules */ - protected function validateFile($object, $attribute, $file) + public function validateFile($object, $attribute, $file) { parent::validateFile($object, $attribute, $file); - if (false === $object->hasErrors($attribute)) { + if (!$object->hasErrors($attribute)) { $this->validateImage($object, $attribute, $file); } }