8require_once dirname(__FILE__) . 
'/HTMLPurifier.auto.php';
 
   10function kses($string, $allowed_html, $allowed_protocols = 
null)
 
   13    $allowed_elements = array();
 
   14    $allowed_attributes = array();
 
   15    foreach ($allowed_html as $element => 
$attributes) {
 
   16        $allowed_elements[$element] = 
true;
 
   18            $allowed_attributes[
"$element.$attribute"] = 
true;
 
   21    $config->set(
'HTML.AllowedElements', $allowed_elements);
 
   22    $config->set(
'HTML.AllowedAttributes', $allowed_attributes);
 
   23    if ($allowed_protocols !== 
null) {
 
   24        $config->set(
'URI.AllowedSchemes', $allowed_protocols);
 
   27    return $purifier->purify($string);
 
HTMLPurifier($html, $config=null)
Purify HTML.
kses($string, $allowed_html, $allowed_protocols=null)
An exception for terminatinating execution or to throw for unit testing.
static createDefault()
Convenience constructor that creates a default configuration object.