aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/text.php')
-rwxr-xr-xinclude/text.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php
index e1fc0ade5..00e95a2bb 100755
--- a/include/text.php
+++ b/include/text.php
@@ -81,6 +81,22 @@ function escape_tags($string) {
}
+function purify_html($s) {
+ require_once('library/HTMLPurifier.auto.php');
+ require_once('include/html2bbcode.php');
+
+// FIXME this function has html output, not bbcode - so safely purify these
+// $s = html2bb_video($s);
+// $s = oembed_html2bbcode($s);
+
+ $config = HTMLPurifier_Config::createDefault();
+ $config->set('Cache.DefinitionImpl', null);
+
+ $purifier = new HTMLPurifier($config);
+ return $purifier->purify($s);
+}
+
+
// generate a string that's random, but usually pronounceable.
// used to generate initial passwords