mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-08 23:08:42 +00:00
4c24a51054
- Improve documentation for stub files - Synchronize stub files between extras/ and library/ - Remove unnecessary include in function file - Remove special treatment of Bootstrap - Improve docs for HTMLPurifier, converted singleton to use static member variables and removed reference - Add HTMLPurifier.path.php stub file - Update sample test settings - Reorganize includes in test files git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1559 48356398-32a2-884e-a903-53898d9a118a
23 lines
523 B
PHP
23 lines
523 B
PHP
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Defines a function wrapper for HTML Purifier for quick use.
|
|
* @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
|
|
*/
|
|
|
|
/**
|
|
* Purify HTML.
|
|
* @param $html String HTML to purify
|
|
* @param $config Configuration to use, can be any value accepted by
|
|
* HTMLPurifier_Config::create()
|
|
*/
|
|
function HTMLPurifier($html, $config = null) {
|
|
static $purifier = false;
|
|
if (!$purifier) {
|
|
$purifier = new HTMLPurifier();
|
|
}
|
|
return $purifier->purify($html, $config);
|
|
}
|
|
|