Release 2.1.0.
[htmlpurifier.git] / library / HTMLPurifier.func.php
blobb8cdacecec76ab3e5bdf16bc4f7725d61b25a192
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);