Skip to content

Commit

Permalink
Changed validateFile() method access from protected to public, fixed …
Browse files Browse the repository at this point in the history
…hasErrors check
  • Loading branch information
tarasio committed Nov 5, 2013
1 parent 3ef20e5 commit 11c78cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion framework/yii/validators/FileValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function validateAttribute($object, $attribute)
* @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:
Expand Down
4 changes: 2 additions & 2 deletions framework/yii/validators/ImageValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ public function init()
* @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);
}
}
Expand Down

0 comments on commit 11c78cb

Please sign in to comment.