aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-18 20:07:46 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-18 20:07:46 +0100
commitadf17b677edeb2387671f6a0f12123e7497b5938 (patch)
tree8fd87d7bf5699488ffc12afa991011e80ac1011b /inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php
parent894cd087f41d605f2f093aaad1300825f705e009 (diff)
downloadwallabag-adf17b677edeb2387671f6a0f12123e7497b5938.tar.gz
wallabag-adf17b677edeb2387671f6a0f12123e7497b5938.tar.zst
wallabag-adf17b677edeb2387671f6a0f12123e7497b5938.zip
remove 3rd libraries
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php30
1 files changed, 0 insertions, 30 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php b/inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php
deleted file mode 100644
index cf0c322f..00000000
--- a/inc/3rdparty/htmlpurifier/HTMLPurifier.kses.php
+++ /dev/null
@@ -1,30 +0,0 @@
1<?php
2
3/**
4 * @file
5 * Emulation layer for code that used kses(), substituting in HTML Purifier.
6 */
7
8require_once dirname(__FILE__) . '/HTMLPurifier.auto.php';
9
10function kses($string, $allowed_html, $allowed_protocols = null)
11{
12 $config = HTMLPurifier_Config::createDefault();
13 $allowed_elements = array();
14 $allowed_attributes = array();
15 foreach ($allowed_html as $element => $attributes) {
16 $allowed_elements[$element] = true;
17 foreach ($attributes as $attribute => $x) {
18 $allowed_attributes["$element.$attribute"] = true;
19 }
20 }
21 $config->set('HTML.AllowedElements', $allowed_elements);
22 $config->set('HTML.AllowedAttributes', $allowed_attributes);
23 if ($allowed_protocols !== null) {
24 $config->set('URI.AllowedSchemes', $allowed_protocols);
25 }
26 $purifier = new HTMLPurifier($config);
27 return $purifier->purify($string);
28}
29
30// vim: et sw=4 sts=4