1
0
Fork 0
friendica_2020-09-1_sharedH.../vendor/ezyang/htmlpurifier/library/HTMLPurifier.func.php

26 lines
576 B
PHP
Raw Normal View History

2010-09-09 05:14:17 +02:00
<?php
/**
* @file
* Defines a function wrapper for HTML Purifier for quick use.
* @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
*/
/**
* Purify HTML.
2016-02-09 11:06:17 +01:00
* @param string $html String HTML to purify
* @param mixed $config Configuration to use, can be any value accepted by
2010-09-09 05:14:17 +02:00
* HTMLPurifier_Config::create()
2016-02-09 11:06:17 +01:00
* @return string
2010-09-09 05:14:17 +02:00
*/
2016-02-09 11:06:17 +01:00
function HTMLPurifier($html, $config = null)
{
2010-09-09 05:14:17 +02:00
static $purifier = false;
if (!$purifier) {
$purifier = new HTMLPurifier();
}
return $purifier->purify($html, $config);
}
// vim: et sw=4 sts=4