php - A better strip_tags alternative? -
i have website ckeditor, prevent xss attacks used strip_tags problem breaks wyiswyg editor (ckeditor).
like, stackoverflow secure xss attacks not block tags.
how can acomplish same effect?
i want users able share code
php's strip_tags supports allowed tags example direct php docs site:
$text = '<p>test paragraph.</p><!-- comment --> <a href="#fragment">other text</a>'; echo strip_tags($text); echo "\n"; // allow <p> , <a> echo strip_tags($text, '<p><a>'); //output : //test paragraph. other text //<p>test paragraph.</p> <a href="#fragment">other text</a> maybe can help
Comments
Post a Comment