34 lines
1.4 KiB
PHP
34 lines
1.4 KiB
PHP
<?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'),
|
|
'cacheFileMode' => 0755,
|
|
'settings' => [
|
|
'user_topic_body' => [
|
|
'HTML.Doctype' => 'XHTML 1.0 Transitional',
|
|
'HTML.Allowed' => 'div,b,strong,i,em,a[href|title],ul,ol,ol[start],li,p[style],br,span[style],img[width|height|alt|src],*[style|class],pre,hr,code,h2,h3,h4,h5,h6,blockquote,del,table,thead,tbody,tr,th,td',
|
|
'CSS.AllowedProperties' => 'font,font-size,font-weight,font-style,margin,width,height,font-family,text-decoration,padding-left,color,background-color,text-align',
|
|
'AutoFormat.AutoParagraph' => true,
|
|
'AutoFormat.RemoveEmpty' => true,
|
|
],
|
|
],
|
|
];
|