How do I get an HTML cleaner to remove content from forbidden tags?
I am using this code to set up my HTML cleaner:
$config = \HTMLPurifier_Config::createDefault(); $config->set('HTML.Allowed', 'div,p,ol,ul,li,br'); // only allow these tags $purifier = new \HTMLPurifier($config);
I found that while the HTMLPurifier strips tags like
, the content inside those tags is still included in the stripped output.
How can I get the HTML cleaner to not return content in tags that are not allowed?
I tried adding the following to my code, but it didn't make any difference (the content of the tags
is still showing):
$config->set('Core.HiddenElements', array ( 'script' => true, 'style' => true, 'table' => true ));
source to share
No one has answered this question yet
Check out similar questions: