I have an issue using strip_tags to clean html tags in text coming from tinymce. I have a form where some textarea fields are managed by tinymce and other simple input text.
I need to strip HTML tags from some input in these fields. This works perfecly with standard input text, nothingh happens with text coming from Tinymce. Here a part of the code:
//from input text
$title = $_POST['title'] ;
//from text area loaded by tynymce
$shortcontent = $_POST['shortcontent'] ;
$content = $_POST['content'] ;
$title = strip_tags($title) ; // works
$content = strip_tags($content) ; //fail
In meantime, SOLVED.
Simply, tags insertet in WYSE mode are always encoded, so html_entity_decode() before strip tags
$content = strip_tags(html_entity_decode($content)) ;
You can try to remove the tags on the javascript before posting it on the PHP.