• Resolved tomfreeform

    (@tomfreeform)


    Hi, I ran into an error when submitting a form without a file attached, which caused a 500 error on the server.

    This is the error message:

    count(): Parameter must be an array or an object that implements Countable in [site_path]/wp-content/plugins/drag-and-drop-multiple-file-upload-contact-form-7/inc/dnd-upload-cf7.php:465

    I was able to fix this by added the is_countable() function into the conditional statement. such that the line on 465 looked like this:

    $multiple_files = ( ( isset( $_POST[ $name ] ) && is_countable($_POST[ $name ]) && count( $_POST[ $name ] ) > 0 ) ? $_POST[ $name ] : null );

    I was hoping that a solution of this nature could be implemented on the next update so that I do not run into this issue when the plugin is updated.

    Many Thanks.

    • This topic was modified 3 years, 10 months ago by tomfreeform.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Error when no files were uploaded to non-required upload field’ is closed to new replies.