【问题标题】:How to whitelist just some attributes with HTMLpurifier?如何使用 HTMLpurifier 将某些属性列入白名单?
【发布时间】:2009-03-21 21:28:00
【问题描述】:

如何使用 HTMLpurifier 将一些属性列入白名单? 我希望 HTMLpurifier 删除所有其他不允许的属性。

【问题讨论】:

    标签: attributes whitelist htmlpurifier


    【解决方案1】:

    HTML.AllowedAttributes。请注意when using HTML.AllowedAttributes, you need to also be using HTML.AllowedElements。和you'll probably need to add more as you go along。就像AllowedFrameTargets for target="", AllowedRel, AllowedRev, EnableAttrID, ... 没有太多选择,但要彻底测试。

    【讨论】:

    • 这是选项,但我如何检查它是否没有被任何东西覆盖?
    猜你喜欢
    • 2012-03-18
    • 2014-04-22
    • 1970-01-01
    • 2012-08-03
    • 2017-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-23
    相关资源
    最近更新 更多