forked from Attendize/Attendize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurifier.php
42 lines (39 loc) · 1.72 KB
/
purifier.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Ok, glad you are here
* first we get a config instance, and set the settings
* $config = HTMLPurifier_Config::createDefault();
* $config->set('Core.Encoding', $this->config->get('purifier.encoding'));
* $config->set('Cache.SerializerPath', $this->config->get('purifier.cachePath'));
* if ( ! $this->config->get('purifier.finalize')) {
* $config->autoFinalize = false;
* }
* $config->loadArray($this->getConfig());.
*
* You must NOT delete the default settings
* anything in settings should be compacted with params that needed to instance HTMLPurifier_Config.
*
* @link http://htmlpurifier.org/live/configdoc/plain.html
*/
return [
'encoding' => 'UTF-8',
'finalize' => true,
'cachePath' => storage_path('app/purifier'),
'settings' => [
'default' => [
'HTML.Doctype' => 'HTML 4.01 Transitional',
'HTML.Allowed' => 'a[href|title],b,blockquote,br,code,dd,del,div,dl,dt,em,h1,h2,h3,h4,h5,h6,hr,i,img[width|height|alt|src],ins,kbd,li,ol,p,p[style],pre,q,s,samp,span[style],strike,strong,sub,sup,table[summary],tbody,td[abbr],tfoot,th[abbr],thead,tr,tt,ul,var',
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,font-family,text-decoration,padding-left,color,background-color,text-align',
'AutoFormat.AutoParagraph' => true,
'AutoFormat.RemoveEmpty' => true,
'AutoFormat.Linkify' => true,
],
'strip_all' => [
'HTML.Allowed' => '',
],
'youtube' => [
'HTML.SafeIframe' => 'true',
'URI.SafeIframeRegexp' => '%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%',
],
],
];