Cornerstone Forms 1.0.13 – Email action fails with multiple file uploads

When a File input has “Multiple” enabled (name=“file-attachment[]”) and the Email action attaches it via an attachment of type “Form Data”, submitting the form fails with:

Email Action : preg_match(): Argument #2 ($subject) must be of type
string, array given

No email is sent.

Cause: extension/Actions/EmailAction.php, render(), branch type === ‘form’:
named_tmp_file($_FILES[$key][‘tmp_name’], $_FILES[$key][‘name’]) assumes a single file. With a multiple input both values are arrays, and sanitize_file_name() fails on the name array.

Expected: every uploaded file is attached. Suggested fix: loop over the arrays and call named_tmp_file() per file (skip entries with an upload error).

Hello @raye,

Thanks for writing to us.

To help you with your concerns we need to check your settings, I would request please share the admin login details meanwhile I would suggest you troubleshoot a few of the common issues before we investigate your settings. Please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin-level username and password
  • Exact page URL

You can find the Secure Note button at the bottom of your posts

Thanks