wproUtilities

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.

Example:

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:

<?php

include_once('wysiwygPro/wproUtilities.class.php');

$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....

?>
 

Properties and methods:

For more sophisticated validation of HTML code you might like to investigate PHP's Tidy extension: http://www.php.net/tidy 


This online documentation specifically covers version 3.0 and above, developers using earlier versions should refer to their PDF or MS-Word manual that was included in the product download.

WysiwygPro.com