Release 1.6.1, merged in 931 to HEAD.
[htmlpurifier.git] / library / HTMLPurifier.func.php
blob876ad7b298d860222af226779792a5e934c4f595
1 <?php
3 /**
4 * Function wrapper for HTML Purifier for quick use.
5 * @note This function only includes the library when it is called. While
6 * this is efficient for instances when you only use HTML Purifier
7 * on a few of your pages, it murders bytecode caching. You still
8 * need to add HTML Purifier to your path.
9 * @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
12 function HTMLPurifier($html, $config = null) {
13 static $purifier = false;
14 if (!$purifier) {
15 require_once 'HTMLPurifier.php';
16 $purifier = new HTMLPurifier();
18 return $purifier->purify($html, $config);