diff --git a/framework/yii/helpers/HtmlPurifier.php b/framework/yii/helpers/HtmlPurifier.php index 1173091..efba874 100644 --- a/framework/yii/helpers/HtmlPurifier.php +++ b/framework/yii/helpers/HtmlPurifier.php @@ -26,6 +26,9 @@ namespace yii\helpers; * * For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/). * + * Note that you should add `ezyang/htmlpurifier` to your composer.json `require` section and run `composer install` + * before using it. + * * @author Alexander Makarov * @since 2.0 */ diff --git a/framework/yii/helpers/base/HtmlPurifier.php b/framework/yii/helpers/base/HtmlPurifier.php index 799dabf..9c4835f 100644 --- a/framework/yii/helpers/base/HtmlPurifier.php +++ b/framework/yii/helpers/base/HtmlPurifier.php @@ -25,7 +25,9 @@ class HtmlPurifier */ 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()); return $purifier->purify($content); }