mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-01 11:50:28 +02:00
[1.2.0]
- Partially finished migrating to new Context object (done in r485). - Created HTMLPurifier_Harness to assist with testing, ChildDefTest migrated to that framework. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@484 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
// they get included
|
||||
require_once 'HTMLPurifier/ConfigSchema.php';
|
||||
require_once 'HTMLPurifier/Config.php';
|
||||
require_once 'HTMLPurifier/Context.php';
|
||||
|
||||
require_once 'HTMLPurifier/Lexer.php';
|
||||
require_once 'HTMLPurifier/Generator.php';
|
||||
@@ -95,16 +96,17 @@ class HTMLPurifier
|
||||
*/
|
||||
function purify($html, $config = null) {
|
||||
$config = $config ? $config : $this->config;
|
||||
$html = $this->encoder->convertToUTF8($html, $config);
|
||||
$context =& new HTMLPurifier_Context();
|
||||
$html = $this->encoder->convertToUTF8($html, $config, $context);
|
||||
$html =
|
||||
$this->generator->generateFromTokens(
|
||||
$this->strategy->execute(
|
||||
$this->lexer->tokenizeHTML($html, $config),
|
||||
$config
|
||||
$this->lexer->tokenizeHTML($html, $config, $context),
|
||||
$config, $context
|
||||
),
|
||||
$config
|
||||
$config, $context
|
||||
);
|
||||
$html = $this->encoder->convertFromUTF8($html, $config);
|
||||
$html = $this->encoder->convertFromUTF8($html, $config, $context);
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user