Question

In my project I use php and yii framework. I have a predefined set of the disallowed html tags(for example - "script, object") and I need to check that entered text don't contain any of these tags.

What function I can use in order to do that ?

Was it helpful?

Solution

If you're dealing with potentially unsafe HTML from the client (WYSIWYG editors etc.), I'd use a library like HTML Purifier. It lets you to specify allowed and disallowed tags.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top