Allow only specific classes in class attribute in HTML cleaner

I know that I can set allowed tags and end up attributes in an HTML cleaner with something like:

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

but how can I also prohibit any attribute values โ€‹โ€‹that do not match certain predefined values?

For example, I can enable the div + tag:

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

but only if the class has abc, def or xyz

+4
source share
1 answer

Install Attr.AllowedClasses . restrict only the classes you would like to allow.

+2
source

Source: https://habr.com/ru/post/1346837/


All Articles