1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 21:28:06 +02:00

Initial implementation of XHTMLDefinition, you can see it in action at the smoketest printDefinition.php?x (add the x at the end).

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@707 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-02-04 00:07:52 +00:00
parent 806901cfd2
commit f6b50d4bfd
6 changed files with 299 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
<?php
require_once 'HTMLPurifier/Printer.php';
require_once 'HTMLPurifier/XHTMLDefinition.php';
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
{
@@ -13,7 +14,14 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
function render($config) {
$ret = '';
$this->config =& $config;
$this->def = $config->getHTMLDefinition();
if (isset($_GET['x'])) { // hidden settings
$this->def = new HTMLPurifier_XHTMLDefinition();
$this->def->initialize($config);
$this->def->setup($config);
} else {
$this->def = $config->getHTMLDefinition();
}
$def =& $this->def;
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));