mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 16:31:53 +00:00
1a3887de1b
git-svn-id: http://htmlpurifier.org/svnroot/html_purifier/trunk@35 48356398-32a2-884e-a903-53898d9a118a
26 lines
545 B
PHP
26 lines
545 B
PHP
<?php
|
|
|
|
class HTML_Purifier
|
|
{
|
|
|
|
var $lexer;
|
|
var $definition;
|
|
var $generator;
|
|
|
|
function HTML_Purifier() {
|
|
$this->lexer = new HTML_Lexer();
|
|
$this->definition = new PureHTMLDefinition();
|
|
$this->generator = new HTML_Generator();
|
|
}
|
|
|
|
function purify($html) {
|
|
|
|
$tokens = $this->lexer->tokenizeHTML($html);
|
|
$tokens = $this->definition->purifyTokens($tokens);
|
|
return $this->generator->generateFromTokens($tokens);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|