HTMLPurifier cache settings, put stuff in subdir of get_sys_temp_dir()

This commit is contained in:
Mikael Nordfeldth 2016-02-28 13:30:47 +01:00
parent cd978fa153
commit 747c91210f
2 changed files with 9 additions and 2 deletions

View File

@ -296,11 +296,15 @@ $default =
array('handle' => false, // whether to handle sessions ourselves array('handle' => false, // whether to handle sessions ourselves
'debug' => false, // debugging output for sessions 'debug' => false, // debugging output for sessions
'gc_limit' => 1000), // max sessions to expire at a time 'gc_limit' => 1000), // max sessions to expire at a time
'htmlfilter' => array( // purify HTML through HTMLPurifier 'htmlfilter' => [ // remove tags from user/remotely generated HTML if they are === true
'img' => true, 'img' => true,
'video' => true, 'video' => true,
'audio' => true, 'audio' => true,
), ],
'htmlpurifier' => [ // configurable options for HTMLPurifier
'Cache.DefinitionImpl' => 'Serializer',
'Cache.SerializerPath' => implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), 'gnusocial']),
],
'notice' => 'notice' =>
array('contentlimit' => null, array('contentlimit' => null,
'allowprivate' => false, // whether to allow users to "check the padlock" to publish notices available for their subscribers. 'allowprivate' => false, // whether to allow users to "check the padlock" to publish notices available for their subscribers.

View File

@ -600,6 +600,9 @@ function common_purify($html, array $args=array())
$cfg->set('URI.Base', $args['URI.Base']); // if null this is like unsetting it I presume $cfg->set('URI.Base', $args['URI.Base']); // if null this is like unsetting it I presume
$cfg->set('URI.MakeAbsolute', !is_null($args['URI.Base'])); // if we have a URI base, convert relative URLs to absolute ones. $cfg->set('URI.MakeAbsolute', !is_null($args['URI.Base'])); // if we have a URI base, convert relative URLs to absolute ones.
} }
foreach (common_config('htmlpurifier') as $key=>$val) {
$cfg->set($key, $val);
}
// Remove more elements than what the default filter removes, default in GNU social are remotely // Remove more elements than what the default filter removes, default in GNU social are remotely
// linked resources such as img, video, audio // linked resources such as img, video, audio