Skip to content

Commit

Permalink
Merge pull request #321 from wpbrasil/fix-error-file-upload-not-required
Browse files Browse the repository at this point in the history
Fix #317 upload problem if file is not required
  • Loading branch information
claudiosanches committed Jul 26, 2015
2 parents a3442f0 + 26c1188 commit e2b279a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/classes/abstracts/abstract-front-end-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ protected function validate_form_data() {
}
break;
case 'file':
if ( $files ) {
if ( count($files) >= 1 ) {
if ( $required && empty( $files[ $id ]['name'] ) ) {
$this->set_errors( sprintf( __( '%s is required.', 'odin' ), '<strong>' . $label . '</strong>' ) );
}
Expand Down

0 comments on commit e2b279a

Please sign in to comment.