<<< Coding for the future >>>
| HTMLpurifer and TinyMce |
|
|
|
| Written by Administrator |
| Sunday, 14 March 2010 23:06 |
|
A bit tricky if your new to htmlpurifier and tincymce (like me) to figure how why HTMLpurifier isn't filtering the code correctly. After cycling through various options the only manner I could get them working together was to use the php function htmlspecialchars_decode() on the input from the TinyMCE editor and then run htmlpurifier on it. If that's not clear, then let me explain another way. A user types some javascript into the tineMCE editor. The htmlpurifier fails to remove it outright. To get it to do so I had to do the following: $inputtext = text from your tinyMCE editor pass to your php file. $sampleText=htmlspecialchars_decode($inputtext); $config = HTMLPurifier_Config::createDefault(); //SOME MORE CONFIG OPTIONS
|
| Last Updated on Sunday, 14 March 2010 23:17 |
Comments
RSS feed for comments to this post.