|
|
@ -25,7 +25,9 @@ class HtmlPurifier |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function process($content, $config = null) |
|
|
|
public static function process($content, $config = null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$purifier=\HTMLPurifier::instance($config); |
|
|
|
$configInstance = \HTMLPurifier_Config::create($config); |
|
|
|
|
|
|
|
$configInstance->autoFinalize = false; |
|
|
|
|
|
|
|
$purifier=\HTMLPurifier::instance($configInstance); |
|
|
|
$purifier->config->set('Cache.SerializerPath', \Yii::$app->getRuntimePath()); |
|
|
|
$purifier->config->set('Cache.SerializerPath', \Yii::$app->getRuntimePath()); |
|
|
|
return $purifier->purify($content); |
|
|
|
return $purifier->purify($content); |
|
|
|
} |
|
|
|
} |
|
|
|