Browse Source

minor refactoring of FileValidator.

tags/2.0.0-rc
Qiang Xue 10 years ago
parent
commit
9fd920e2d1
  1. 2
      framework/validators/FileValidator.php

2
framework/validators/FileValidator.php

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

Loading…
Cancel
Save