3 require_once 'common.php';
5 $config = HTMLPurifier_Config
::createDefault();
6 $config->set('HTML.Doctype', 'HTML 4.01 Strict');
7 $config->set('HTML.Allowed', 'b,a[href],br');
8 $config->set('CSS.AllowTricky', true);
9 $config->set('URI.Disable', true);
10 $serial = $config->serialize();
12 $result = unserialize($serial);
13 $purifier = new HTMLPurifier($result);
14 echo htmlspecialchars($purifier->purify('<b>Bold</b><br><i><a href="http://google.com">no</a> formatting</i>'));