Whitelist Forms in HTML Purifier Configuration

寵の児 提交于 2019-12-22 18:29:40

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!