set('HTML.Allowed',
'p[style|align],br,strong,b,em,i,u,sup,sub,hr,pre,code,' .
'blockquote[style],div[style|align],span[style],ul,ol,li,a[href|title]');
$config->set('CSS.AllowedProperties', array('text-align', 'padding-left', 'margin-left'));
$config->set('URI.AllowedSchemes', array('http' => TRUE, 'https' => TRUE, 'mailto' => TRUE));
// HTML Purifier caches its definitions; keep the cache out of the web root
$cache = sys_get_temp_dir() . '/xxx-htmlpurifier';
if (!is_dir($cache))
@mkdir($cache, 0700, TRUE);
$config->set('Cache.SerializerPath', $cache);
$purifier = new HTMLPurifier($config);
}
return $purifier->purify((string)$html);
}
?>