summaryrefslogtreecommitdiffstats
path: root/3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 22:53:36 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-10-21 22:53:36 +0200
commitfe030e7339f5fc9ec4e75d9655b2ced0900da5c2 (patch)
treed87fc2bc4504392550c3aea0abb18614d36f8abb /3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php
parent8c2a1b242c1cd2f7bcb179facc524f3454e7a863 (diff)
use composer for autoloading repos
Diffstat (limited to '3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php')
-rw-r--r--3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php b/3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php
new file mode 100644
index 000000000..64b140bec
--- /dev/null
+++ b/3rdparty/ezyang/htmlpurifier/library/HTMLPurifier.func.php
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @file
+ * Defines a function wrapper for HTML Purifier for quick use.
+ * @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()''
+ */
+
+/**
+ * Purify HTML.
+ * @param string $html String HTML to purify
+ * @param mixed $config Configuration to use, can be any value accepted by
+ * HTMLPurifier_Config::create()
+ * @return string
+ */
+function HTMLPurifier($html, $config = null)
+{
+ static $purifier = false;
+ if (!$purifier) {
+ $purifier = new HTMLPurifier();
+ }
+ return $purifier->purify($html, $config);
+}
+
+// vim: et sw=4 sts=4