mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 00:41:52 +00:00
404ca68c87
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@69 48356398-32a2-884e-a903-53898d9a118a
26 lines
576 B
PHP
26 lines
576 B
PHP
<?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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|