My title might be a bit confusing, so I'll explain further.
I'm using HTML_purifier to sanitize user input, although in this case, the only user will be myself (it's in password-protected folders). To keep it short, I want to be able to add image tag code to a web form and then display that image on the page it sends to. However, I need the image tag to have CSS attributes added to it, specifically
display:block
By default, HTML_purifier removes this due to the CSS.allowTricky option, detailed here. Setting the CSS.allowTricky option to True should allow
display:block
Despite doing this, it's still being removed. Has anyone encountered this before? There isn't much documentation available online. It's not generating any errors in syslog, so I assume the implementation is correct but not working as expected.
My current code looks like this:
include('HTMLPurifier.standalone.php');
$config = HTMLPurifier_Config::createDefault();
$config->set('CSS.AllowTricky', true);
* UPDATE *
The code needs to pass the config object (which has already been set) to the HTML purifier object. Putting it together, it should look something like this:
include('HTMLPurifier.standalone.php');
$config = HTMLPurifier_Config::createDefault();
$config->set('CSS.AllowTricky', true);
$purifier = new HTMLPurifier($config);