topical media & game development
professional-search-08-seophp-include-sanitize.inc.php / php
<?php
// sanitizes the HTML code in
function sanitizeHTML(
inputHTML,
_allowed_tags = implode('', inputHTML = strip_tags(_allowed_tags);
return preg_replace('#<(.*?)>#ise', "'<' . removeBadAttributes('\\1') . '>'" , inputHTML
function removeBadAttributes(bad_attributes = 'onerror|onmousemove|onmouseout|onmouseover|' .
'onkeypress|onkeydown|onkeyup|javascript:';
// remove the bad attributes and return the result
return stripslashes(preg_replace("#(inputHTML));
}
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.