]>
Commit | Line | Data |
---|---|---|
d4949327 NL |
1 | <?php\r |
2 | \r | |
3 | /**\r | |
4 | * @file\r | |
5 | * Defines a function wrapper for HTML Purifier for quick use.\r | |
6 | * @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''\r | |
7 | */\r | |
8 | \r | |
9 | /**\r | |
10 | * Purify HTML.\r | |
11 | * @param string $html String HTML to purify\r | |
12 | * @param mixed $config Configuration to use, can be any value accepted by\r | |
13 | * HTMLPurifier_Config::create()\r | |
14 | * @return string\r | |
15 | */\r | |
16 | function HTMLPurifier($html, $config = null)\r | |
17 | {\r | |
18 | static $purifier = false;\r | |
19 | if (!$purifier) {\r | |
20 | $purifier = new HTMLPurifier();\r | |
21 | }\r | |
22 | return $purifier->purify($html, $config);\r | |
23 | }\r | |
24 | \r | |
25 | // vim: et sw=4 sts=4\r |