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

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -