问题
I use HTML Purifier to clean input in my CMS. Many of my clients like to have PayPal donation buttons in their site, but HTML Purifier strips the forms out.
I noticed that HTML Purifier has a HTMLPurifier_HTMLModule_Forms
class, but I don't know if that does what I want. If it does, how do I enable it?
回答1:
$config->set('HTML.Trusted', true);
$config->set('Attr.EnableID', true);
should turn on Forms (I think they’re enabled by default in the trusted set.) Of course, this also allows JavaScript too, so it might not be what you’re looking for...
来源:https://stackoverflow.com/questions/3189396/whitelist-forms-in-html-purifier-configuration