2006-12-06 22:04:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function wrapper for HTML Purifier for quick use.
|
|
|
|
* @note This function only includes the library when it is called. While
|
|
|
|
* this is efficient for instances when you only use HTML Purifier
|
|
|
|
* on a few of your pages, it murders bytecode caching. You still
|
|
|
|
* need to add HTML Purifier to your path.
|
2007-01-11 22:28:44 +00:00
|
|
|
* @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
|
2006-12-06 22:04:16 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
function HTMLPurifier($html, $config = null) {
|
|
|
|
static $purifier = false;
|
|
|
|
if (!$purifier) {
|
|
|
|
require_once 'HTMLPurifier.php';
|
|
|
|
$purifier = new HTMLPurifier();
|
|
|
|
}
|
|
|
|
return $purifier->purify($html, $config);
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|