Advanced css styles getting stripped out on save of emails and email templates

I figured I would share how I fixed/adjusted for advanced css styles getting stripped out of emails. The version of HTMLPurifier included in the current version does not support many CSS3 declarations (such as border-radius) which caused some issues for our organization trying to craft emails that had buttons that did not require image loading.

To fix the issue we pulled the current version from htmlpurifier.org (http://htmlpurifier.org/releases/htmlpurifier-4.10.0-standalone.tar.gz) and put the contents in the include/HTMLPurifier folder. To limit rippling errors we created an empty file /include/HTMLPurifier/HTMLPurifier.autoload.php as the latest version doesn’t require autoload overriding but we weren’t sure how many places within the overall system were trying to load that file ahead of usage.

This worked for us on SuiteCRM 7.10.4 on Ubuntu 16.04 with PHP 7 and MySQL but other combinations have not been tested.

You might like to see what just came up on GitHub:

https://github.com/salesagility/SuiteCRM/pull/5959

1 Like