3 require_once 'common.php';
5 // todo : modularize the HTML in to separate files
12 $page = isset($_GET['p']) ?
$_GET['p'] : false;
13 if (!isset($allowed[$page])) $page = false;
15 $strict = isset($_GET['d']) ?
(bool) $_GET['d'] : false;
17 echo '<?xml version="1.0" encoding="UTF-8" ?>';
19 <?php
if ($strict) { ?
>
21 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
22 "http://www.w3.org/TR/xhtml1/DTD/xhtml1- Strict.dtd">
25 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
26 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
30 <title
>HTML Purifier Basic Smoketest
</title
>
31 <meta http
-equiv
="Content-Type" content
="text/html; charset=UTF-8" />
34 if (file_exists("basic/$page.css")) {
35 ?
><link rel
="stylesheet" href
="basic/<?php echo $page ?>.css" type
="text/css" /><?php
45 <div style
="float:right;"><div
><?php
echo $strict ?
'Strict' : 'Loose'; ?
>:
46 <a href
="?d=<?php echo (int) !$strict; ?>&p=<?php echo $page ?>">Swap
</a
></div
>
47 <a href
="http://validator.w3.org/check?uri=referer"><img
48 src
="http://www.w3.org/Icons/valid-xhtml10"
49 alt
="Valid XHTML 1.0 Transitional" height
="31" width
="88" style
="border:0;" /></a
>
52 $config = HTMLPurifier_Config
::createDefault();
53 $config->set('Attr', 'EnableID', true);
54 $config->set('HTML', 'Strict', $strict);
55 $purifier = new HTMLPurifier($config);
56 echo $purifier->purify(file_get_contents("basic/$page.html"));
59 <h1
>HTML Purifier Basic Smoketest Index
</h1
>
62 foreach ($allowed as $val => $b) {
63 ?
><li
><a href
="?p=<?php echo $val ?>"><?php
echo $val ?
></a
></li
><?php