diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-03 12:56:29 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-03 12:56:29 -0700 |
commit | b6e5bf6eaade677187f99182e7face7c4b711bec (patch) | |
tree | 41c31bb904d42f358bc09fc78aa063c3e875ab04 /modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php | |
parent | cf279fc315841836f92c8a81935db00bb3a919ff (diff) |
Fix for ticket #400: Add HTMLPurifier to gallery3 and change p::clean() to call HTMLPurifier->purify()
Diffstat (limited to 'modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php')
-rw-r--r-- | modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php new file mode 100644 index 00000000..56a55b2f --- /dev/null +++ b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier.func.php @@ -0,0 +1,23 @@ +<?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); +} + +// vim: et sw=4 sts=4 |