fix isEmpty method for file validator.

This commit is contained in:
Zhandos Nuftiev
2014-03-10 23:10:47 +05:00
parent cd7e51df7d
commit b3b9bd353e
3 changed files with 67 additions and 1 deletions

View File

@ -229,7 +229,9 @@ class FileValidator extends Validator
*/
public function isEmpty($value, $trim = false)
{
return !$value instanceof UploadedFile || $value->error == UPLOAD_ERR_NO_FILE;
$value = is_array($value) && !empty($value) ? $value[0] : $value;
return !$value instanceof UploadedFile || $value->error == UPLOAD_ERR_NO_FILE;
}
/**