Support

Home Forums Event Espresso Premium Found an odd conflict, Event Espresso generated PDFs and iThemes Security…

Found an odd conflict, Event Espresso generated PDFs and iThemes Security…

Posted: February 3, 2021 at 10:17 am


GravityStack

February 3, 2021 at 10:17 am

Hello!

This isn’t exactly a support request, as I was able to make stuff work, but I thought I should bring it to your attention because it seems…weird.

I was having a problem with the Order Confirmation PDF, it looked great as a web page, but when I clicked “Download PDF” it came out missing all images and formatting. Here’s what it looked like, web page vs PDF: https://imgur.com/a/HHyXSYs

I found another similar support thread which said “it looks like allow_url_fopen has been disabled on your server” but I checked and that was not the case.

Eventually the solution I found was to un-check a setting in iThemes Security, under Banned Users > “Enable HackRepair.com’s ban list feature”.

With HackRepair.com’s ban list feature disabled, the PDF works perfectly, all images and formatting present. If I enable it again, it goes back to broken. Very strange. I have enough other security measures active, and PDFs are working, so my case needs no urgent attention, but it seems like something that shouldn’t happen, perhaps there is something there that should be addressed, and hopefully this will be helpful if anyone else is experiencing the same problem.


Tony

  • Support Staff

February 3, 2021 at 2:38 pm

Hi there,

Thank you for the report, we’ve actually seen this before and it’s from the HackRepair list using this rule:

RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR]

Which blocks any requests with no user_agent set.

With DOMPDF it uses get_file_contents() to pull ‘external’ files into the PDF (images, CSS etc) and that function will use the user_agent set on your servers php.ini file, which based on the above, is likely empty so then gets the request blocked.

One option is to update your php.ini file to include a valid user_agent value, or you can whitelist the above before the HackRepair rule is set, see:

https://stackoverflow.com/questions/25985257/this-rule-give-me-headaches-rewritecond-http-user-agent-nc-or

The support post ‘Found an odd conflict, Event Espresso generated PDFs and iThemes Security…’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso