开发者

Allow only specific classes within the class attribute in HTML purifier

I know that I can set the allowed tags and eventually attributes in HTML Purifier开发者_如何学JAVA with something like:

$cfg->set('HTML.Allowed', 'a[href|title],'b','em','i','strike');

but how can I also disallow any attribute values that do not match certain predefined values?

For example I may want to allow the div + class tag:

$cfg->set('HTML.Allowed', 'div[class],a[href|title],'b','em','i','strike');

but only if the class is abc, def or xyz


Set Attr.AllowedClasses. to limit only those classes you would like to allow.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜