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:
@@ -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'));
|
||||
|
Reference in New Issue
Block a user