2007-05-05 18:41:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require 'common.php';
|
|
|
|
|
2008-12-06 07:28:20 +00:00
|
|
|
?><!DOCTYPE html
|
2007-05-05 18:41:53 +00:00
|
|
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
|
|
<head>
|
|
|
|
<title>HTML Purifier Attribute Transformation Smoketest</title>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<style type="text/css">
|
|
|
|
div.container {position:relative;height:120px;border:1px solid #CCC;
|
|
|
|
margin-bottom:1em; width:225px; float:left; margin-top:1em;
|
|
|
|
margin-right:1em;}
|
|
|
|
h2 {clear:left;margin-bottom:0;}
|
|
|
|
div.container.legend .test {text-align:center;line-height:100px;}
|
|
|
|
div.test {width:100px;height:100px;border:1px solid black;
|
|
|
|
position:absolute;top:10px;overflow:auto;}
|
|
|
|
div.test.html {left:10px;border-right:none;background:#FCC;}
|
|
|
|
div.test.css {left:110px;background:#CFC;}
|
|
|
|
img.marked {border:1px solid #000;background:#FFF;}
|
|
|
|
table.bright {background-color:#F00;}
|
|
|
|
hr.short {width:50px;}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>HTML Purifier Attribute Transformation Smoketest</h1>
|
|
|
|
<div class="container legend">
|
|
|
|
<div class="test html">
|
|
|
|
HTML
|
|
|
|
</div>
|
|
|
|
<div class="test css">
|
|
|
|
CSS
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if (version_compare(PHP_VERSION, '5', '<')) exit('<p>Requires PHP 5.</p>');
|
|
|
|
|
|
|
|
$xml = simplexml_load_file('attrTransform.xml');
|
|
|
|
|
|
|
|
// attr transform enabled HTML Purifier
|
|
|
|
$config = HTMLPurifier_Config::createDefault();
|
2007-05-20 02:12:01 +00:00
|
|
|
$config->set('HTML', 'Doctype', 'XHTML 1.0 Strict');
|
2007-05-05 18:41:53 +00:00
|
|
|
$purifier = new HTMLPurifier($config);
|
|
|
|
|
|
|
|
$title = isset($_GET['title']) ? $_GET['title'] : true;
|
|
|
|
|
|
|
|
foreach ($xml->group as $group) {
|
|
|
|
echo '<h2>' . $group['title'] . '</h2>';
|
|
|
|
foreach ($group->sample as $sample) {
|
|
|
|
$sample = (string) $sample;
|
|
|
|
?>
|
|
|
|
<div class="container">
|
|
|
|
<div class="test html">
|
|
|
|
<?php echo $sample; ?>
|
|
|
|
</div>
|
|
|
|
<div class="test css">
|
|
|
|
<?php echo $purifier->purify($sample); ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
</body>
|
2007-06-27 13:58:32 +00:00
|
|
|
</html>
|
2008-12-06 09:24:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|