Skip to content

Commit 6abca8a

Browse files
committed
Forgot to add the config purifier.
1 parent 8ca84d8 commit 6abca8a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

config/purifier.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* Ok, glad you are here
4+
* first we get a config instance, and set the settings
5+
* $config = HTMLPurifier_Config::createDefault();
6+
* $config->set('Core.Encoding', $this->config->get('purifier.encoding'));
7+
* $config->set('Cache.SerializerPath', $this->config->get('purifier.cachePath'));
8+
* if ( ! $this->config->get('purifier.finalize')) {
9+
* $config->autoFinalize = false;
10+
* }
11+
* $config->loadArray($this->getConfig());
12+
*
13+
* You must NOT delete the default settings
14+
* anything in settings should be compacted with params that needed to instance HTMLPurifier_Config.
15+
*
16+
* @link http://htmlpurifier.org/live/configdoc/plain.html
17+
*/
18+
19+
return [
20+
'encoding' => 'UTF-8',
21+
'finalize' => true,
22+
'cachePath' => storage_path('app/purifier'),
23+
'cacheFileMode' => 0755,
24+
'settings' => [
25+
'default' => [
26+
'HTML.Doctype' => 'XHTML 1.0 Strict',
27+
'HTML.Allowed' => 'div,b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src],h1,h2,h3,h4,h5,h6',
28+
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
29+
'AutoFormat.AutoParagraph' => false,
30+
'AutoFormat.RemoveEmpty' => true,
31+
],
32+
'test' => [
33+
'Attr.EnableID' => true
34+
],
35+
"youtube" => [
36+
"HTML.SafeIframe" => 'true',
37+
"URI.SafeIframeRegexp" => "%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%",
38+
],
39+
],
40+
41+
];

0 commit comments

Comments
 (0)