2006-12-06 22:04:16 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2008-02-17 18:21:45 +00:00
|
|
|
* @file
|
|
|
|
* Defines a function wrapper for HTML Purifier for quick use.
|
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
|
|
|
*/
|
|
|
|
|
2008-02-17 18:21:45 +00:00
|
|
|
/**
|
|
|
|
* Purify HTML.
|
2013-07-16 11:56:14 +00:00
|
|
|
* @param string $html String HTML to purify
|
|
|
|
* @param mixed $config Configuration to use, can be any value accepted by
|
2008-02-17 18:21:45 +00:00
|
|
|
* HTMLPurifier_Config::create()
|
2013-07-16 11:56:14 +00:00
|
|
|
* @return string
|
2008-02-17 18:21:45 +00:00
|
|
|
*/
|
2013-07-16 11:56:14 +00:00
|
|
|
function HTMLPurifier($html, $config = null)
|
|
|
|
{
|
2006-12-06 22:04:16 +00:00
|
|
|
static $purifier = false;
|
|
|
|
if (!$purifier) {
|
|
|
|
$purifier = new HTMLPurifier();
|
|
|
|
}
|
|
|
|
return $purifier->purify($html, $config);
|
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|