I would like to make sure my HTML Purifier removes all elements other than these:
br, a, img, div, embed, object, u, em, ul, ol, li, strong, span
these elements will have many attributes.
What can i do?
I thought to use strip_tags before going into purifier.
My code:
$config = HTMLPurifier_Config::createDefault();
$config->set('Attr.AllowedFrameTargets', array('_blank'));
$config->set('HTML.SafeObject', true);
$config->set('Output.FlashCompat', true);
$config->set('HTML.SafeEmbed', true);
$purifier = new HTMLPurifier($config);
You can do this:
Note:
*[id|class|name]means that you allow for all the accepted tags the attributes id, class and name (which are usually usefull).