You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ricardo Lopes edited this page Jan 16, 2015
·
2 revisions
php-html has a set of predefined tags allowed. if you wish to just keep that same set, just:
<?php//create a new instance of the filter$htmlFilter = new \HtmlFilter\Filter();
//get your dirty html on the table$dirtyHtml = '<span>this should have nothing more<script>alert(1);</script></span>';
//and start you washing machine$cleanHtml = $htmlFilter->filterHtml($dirtyHtml);
//your html should be squeaky clean now!echo"<pre>$cleanHtml</pre>";