Вопрос

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 ?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top