Availability: >= 3.0
Type: PHP Class Object
Description: This class contains useful functions for post-processing HTML generated by the editor.
File to include: wysiwygPro/wproUtilities.class.php
The functions available through the wproUtilities class can be used to validate the HTML code generated by WysiwygPro.
The following example retrieves the code from an editor named 'myEditor' and then removes unwanted tags, attributes and encodes email addresses to hide them from spam bots:
$code = $_POST['myEditor'];
// encode email addresses:
$code = wproUtilities::emailEncode($code);
// remove unwanted tags
$code = wproUtilities::removeTags ($code, array(
'object' => true,
'embed' => true,
'applet' => true,
'script' => true
// remove unwanted attributes
$code = wproUtilities::removeAttributes($code, array("on[A-Z]+"));
// now you can safely save the code to your database....
For more sophisticated validation of HTML code you might like to investigate PHP's Tidy extension: http://www.php.net/tidy