user63371
user63371

Reputation: 539

How to whitelist just some attributes with HTMLpurifier?

How to whitelist just some attributes with HTMLpurifier? I want HTMLpurifier to delete all the other, not allowed attributes.

Upvotes: 0

Views: 2214

Answers (1)

ax.
ax.

Reputation: 59917

HTML.AllowedAttributes. Note that when using HTML.AllowedAttributes, you need to also be using HTML.AllowedElements. And you'll probably need to add more as you go along. Like AllowedFrameTargets for target="", AllowedRel, AllowedRev, EnableAttrID, ... Not much choice but testing thoroughly.

Upvotes: 1

Related Questions