0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-09 23:28:42 +00:00
htmlpurifier/HTML_Purifier.php

26 lines
561 B
PHP
Raw Normal View History

<?php
class HTML_Purifier
{
var $lexer;
var $definition;
var $generator;
function HTML_Purifier() {
$this->lexer = new HTMLPurifier_Lexer();
$this->definition = new PureHTMLDefinition();
$this->generator = new HTMLPurifier_Generator();
}
function purify($html) {
$tokens = $this->lexer->tokenizeHTML($html);
$tokens = $this->definition->purifyTokens($tokens);
return $this->generator->generateFromTokens($tokens);
}
}
?>