We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 954b831 commit 64112beCopy full SHA for 64112be
includes/services/HtmlPurifierService.php
@@ -13,6 +13,8 @@
13
14
class HtmlPurifierService
15
{
16
+ public const HTMLPURIFIER_CACHE_FODLER = "cache/HTMLpurifier";
17
+
18
protected $params;
19
protected $wiki;
20
private $purifier;
@@ -47,6 +49,13 @@ public function cleanHTML(string $dirty_html): string
47
49
'_top',
48
50
]);
51
52
+ // set the cache folder
53
+ // doc : http://htmlpurifier.org/live/configdoc/plain.html#Cache.SerializerPath
54
+ if (!is_dir(self::HTMLPURIFIER_CACHE_FODLER)) {
55
+ mkdir(self::HTMLPURIFIER_CACHE_FODLER, 0777, true);
56
+ }
57
+ $config->set('Cache.SerializerPath', realpath(self::HTMLPURIFIER_CACHE_FODLER));
58
59
$this->purifier = new HTMLPurifier($config);
60
}
61
0 commit comments