aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormmn <mmn@hethane.se>2017-12-17 17:25:46 +0000
committermmn <mmn@hethane.se>2017-12-17 17:25:46 +0000
commit67a9c0415c395d92adeb784413bb9a88fba7347f (patch)
tree371f5188dc6b2e24620d93da7d2b3f7c04967167
parenta1ea335140a984365b6b5c908689d14afa464a81 (diff)
parent3b5fabbe97b333a7d1137ce5910e340c8444e509 (diff)
downloadgnu-social-master.tar
gnu-social-master.zip
Merge branch 'cache-html-sanitizer' into 'master'HEADmaster
set the html sanitizer cache directory to ['cache']['dir'] from the config file; See merge request gnu/gnu-social!156
-rw-r--r--CONFIGURE7
-rw-r--r--lib/util.php3
2 files changed, 10 insertions, 0 deletions
diff --git a/CONFIGURE b/CONFIGURE
index 25af381332..4a7926f8c9 100644
--- a/CONFIGURE
+++ b/CONFIGURE
@@ -773,6 +773,13 @@ high: if you need high performance, or if you're seeing bad
performance, set this to true. It will turn off some high-intensity code from
the site.
+cache
+-----
+
+dir: A string path to a writable directory that will be used as temporary cache
+ for some functions (currently just the HtmlSanitizer).
+ If it is not set, the GNU social installation directory will be used.
+
oldschool
---------
diff --git a/lib/util.php b/lib/util.php
index 62db64d828..9c32d74433 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -597,6 +597,9 @@ function common_purify($html)
$cfg->set('Attr.AllowedRel', ['bookmark', 'directory', 'enclosure', 'home', 'license', 'nofollow', 'payment', 'tag']); // http://microformats.org/wiki/rel
$cfg->set('HTML.ForbiddenAttributes', array('style')); // id, on* etc. are already filtered by default
$cfg->set('URI.AllowedSchemes', array_fill_keys(common_url_schemes(), true));
+ if (common_config('cache', 'dir')) {
+ $cfg->set('Cache.SerializerPath', common_config('cache', 'dir'));
+ }
// Remove more elements than what the default filter removes, default in GNU social are remotely
// linked resources such as img, video, audio