valonesal 0 Junior Poster

How would I check to see if html purifier is running correctly on our server?

We are using the following

<?php
$doctypes = array( 1 => 'XHTML 1.0 Transitional', 2 => 'XHTML 1.0 Strict', 3 => 'HTML 4.01 Transitional', 4 => 'HTML 4.01 Strict' );
$tidylevels = array( 1 => 'light', 2 => 'medium', 3 => 'heavy' );

require_once 'HTMLPurifier.auto.php';
// configure it
$config = HTMLPurifier_Config :: createDefault();

$config->set( 'Core.Encoding', 'utf-8' );
$config->set( 'Core.RemoveScriptContents', false );
$config->set( 'HTML.Doctype', $doctypes[1] );
$config->set( 'HTML.TidyLevel', $tidylevels[2] );
$config->set( 'HTML.Allowed', null );

$config->set( 'Attr.EnableID', true );
$config->set( 'HTML.Trusted', true );
$config->set( 'CSS.Proprietary', false );
// prevent stripping target="_blank" and similar
$config->set( 'Attr.AllowedFrameTargets', array( 0 => '_self',
1 => '_blank',
2 => '_parent',
3 => '_top'
) );
// perform the replacement
$purifier = new HTMLPurifier( $config );
$data['addesc'] = "<table><tr><td>are</td></tr></table>";
$data['addesc'] = $purifier->purify( $data['addesc'] );
var_dump( $data['addesc'] );

?>

But all we get are errors and are afraid we set something up wrong.

Thank you.