diff options
| author | Greg Roach <fisharebest@gmail.com> | 2014-01-09 21:09:09 +0000 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2014-01-09 21:09:09 +0000 |
| commit | 9cc40d4467f42e95764ee256b9e759d51c982e29 (patch) | |
| tree | 8cf4a97fdac89c2b8191e6c184cffc5407473c7f /library | |
| parent | aa5831434fc2e7fe85fae99610f29e24b5f38b5f (diff) | |
| download | webtrees-9cc40d4467f42e95764ee256b9e759d51c982e29.tar.gz webtrees-9cc40d4467f42e95764ee256b9e759d51c982e29.tar.bz2 webtrees-9cc40d4467f42e95764ee256b9e759d51c982e29.zip | |
HTMLPurifier needs somewhere to store cache files
Diffstat (limited to 'library')
| -rw-r--r-- | library/WT/Filter.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/WT/Filter.php b/library/WT/Filter.php index 7ed6ee3fd8..ef854165e1 100644 --- a/library/WT/Filter.php +++ b/library/WT/Filter.php @@ -112,7 +112,15 @@ class WT_Filter { // HTMLPurifier needs its own autoloader require_once WT_ROOT . 'library/htmlpurifier-4.6.0/library/HTMLPurifier.auto.php'; + // HTMLPurifier needs somewhere to write temporary files + $HTML_PURIFIER_CACHE_DIR = WT_DATA_DIR . 'html_purifier_cache'; + + if (!is_dir($HTML_PURIFIER_CACHE_DIR)) { + mkdir($HTML_PURIFIER_CACHE_DIR); + } + $config = HTMLPurifier_Config::createDefault(); + $config->set('Cache.SerializerPath', $HTML_PURIFIER_CACHE_DIR); $purifier = new HTMLPurifier($config); $text = $purifier->purify($text); |
