Fatal Error: Plugin uses HTML content as filename – causes 500 error on form sub
-
Hi,
I’m experiencing a PHP Fatal Error caused by your plugin that completely
breaks Contact Form 7 submissions, returning a 500 Internal Server Error.Environment:
- WordPress: 6.7.x
- PHP: 8.x
- Contact Form 7: Latest version
- Generate PDF Using Contact Form 7: Latest version
- Hosting: Shared hosting (GoDaddy)
The Problem:
When a visitor submits a CF7 form, the plugin crashes with the following
fatal error, preventing the form from being submitted entirely:PHP Fatal error: Uncaught Mpdf\MpdfException: Unable to create output file
/home/customer/www/example.com/public_html/wp-content/plugins/generate-pdf-using-contact-form-7/attachments/Root Cause:
It appears the plugin is using the raw HTML content of the email body as part of the PDF filename instead of generating a proper sanitized
filename. This creates an invalid file path containing HTML tags like<p>,<style>, etc., which the filesystem cannot handle.The error occurs at:
- File:
generate-pdf-using-contact-form-7/inc/lib/mpdf/vendor/mpdf/mpdf/src/Mpdf.php(line 9609) - Called from:
generate-pdf-using-contact-form-7/inc/front/class.cf7-pdf-generation.front.action.php(line 387)
Stack trace confirms the issue happens during the
wpcf7_before_send_mail
hook when the plugin tries to generate the PDF attachment.Expected Behavior:
The plugin should generate a sanitized filename (e.g.,form-submission-1770619321-0187.pdf)
instead of using HTML content as the filename.Temporary Workaround:
I had to deactivate the plugin entirely to restore form functionality.Steps to Reproduce:
- Install and activate the plugin
- Configure it with any CF7 form
- Submit the form from the frontend
- Form submission fails with 500 error
Could you please look into this filename generation bug? It seems like a
critical issue that would affect all users.Thank you for your time.
The page I need help with: [log in to see the link]
You must be logged in to reply to this topic.