0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00
htmlpurifier/library/HTMLPurifier.php
Edward Z. Yang 1ab3ae160a Move classes into Zend style setup.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@88 48356398-32a2-884e-a903-53898d9a118a
2006-07-22 15:38:41 +00:00

28 lines
687 B
PHP

<?php
require_once 'HTMLPurifier/Lexer.php';
require_once 'HTMLPurifier/Definition.php';
require_once 'HTMLPurifier/Generator.php';
class HTMLPurifier
{
var $lexer;
var $definition;
var $generator;
function HTMLPurifier() {
$this->lexer = new HTMLPurifier_Lexer();
$this->definition = new HTMLPurifier_Definition();
$this->generator = new HTMLPurifier_Generator();
}
function purify($html) {
$tokens = $this->lexer->tokenizeHTML($html);
$tokens = $this->definition->purifyTokens($tokens);
return $this->generator->generateFromTokens($tokens);
}
}
?>