Source for file HTML_Safe_example.php
Documentation is available at HTML_Safe_example.php
define('XML_HTMLSAX3', dirname (__FILE__ ). "/classes/");
STRIKE, S { color:#999999 }
<h2>SAFEHTML Testing interface</h2>
This parser strip down all potentially dangerous content within HTML:
<li> opening tag without its closing tag
<li> closing tag without its opening tag
<li> any of these tags: "base", "basefont", "head", "html", "body", "applet", "object", "iframe", "frame", "frameset", "script", "layer", "ilayer", "embed", "bgsound", "link", "meta", "style", "title", "blink", "xml" etc.
<li> any of these attributes: on*, data*, dynsrc
<li> javascript:/vbscript:/about: etc. protocols
<li> expression/behavior etc. in styles
<li> any other active content
<p>If you found any bugs in this parser, please inform me — ICQ:551593 or <a href=mailto:thingol@mail.ru>thingol@mail.ru</a> - Roman Ivanov.
<form method="post" action=" <?php echo $_SERVER["PHP_SELF"]; ?>">
<textarea name="html" rows="10" cols="100">
if (isset($_POST["html"]))
$_POST["html"] = stripslashes($_POST["html"]);
echo htmlspecialchars($_POST["html"]);
require_once('classes/safehtml.php');
return ((float) $usec + (float) $sec);
if (isset ($_POST["html"]))
// Instantiate the handler
$safehtml = & new safehtml ();
$result = $safehtml->parse ($doc);
echo ( "Parsing took seconds:\t\t". (getmicrotime()- $start) );
echo ('<b>Source code after filtration:</b><br/>');
echo ('<p><b>Code after filtration as is (HTML):</b><br/>');
<li> lj user=ati & lj user=curiousweasel
<li> John "Gozzy" Godsland
<hr /> <a href="http://pixel-apes.com/safehtml">Download Safehtml</a>.
<br /> Copyright © 2004-2005, Roman Ivanov.
<br /> All rights reserved.
Documentation generated on Mon, 11 Mar 2019 14:15:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|