Commit d8622223 by Alex-Code Committed by Alexander Makarov

Fixes #6852: Added `yii\helpers\BaseHtmlPurifier::helpers()` in order to be able…

Fixes #6852: Added `yii\helpers\BaseHtmlPurifier::helpers()` in order to be able to configure `HtmlPurifier` helper globally via subclassing
parent e562f8e4
...@@ -10,6 +10,7 @@ Yii Framework 2 Change Log ...@@ -10,6 +10,7 @@ Yii Framework 2 Change Log
- Enh #6106: Added ability to specify `encode` for each item of `yii\widgets\Breadcrumbs` (samdark, aleksanderd) - Enh #6106: Added ability to specify `encode` for each item of `yii\widgets\Breadcrumbs` (samdark, aleksanderd)
- Enh #6493: Added support for the `Access-Control-Expose-Headers` header by `yii\filters\Cors` (usualdesigner) - Enh #6493: Added support for the `Access-Control-Expose-Headers` header by `yii\filters\Cors` (usualdesigner)
- Enh #6697: Added `yii\helpers\Url::current()` method that allows adding or removing parameters from current URL (samdark, callmez) - Enh #6697: Added `yii\helpers\Url::current()` method that allows adding or removing parameters from current URL (samdark, callmez)
- Enh #6852: Added `yii\helpers\BaseHtmlPurifier::helpers()` in order to be able to configure `HtmlPurifier` helper globally via subclassing (Alex-Code)
- Enh #6882: Added `yii\web\ErrorHandler::getTypeUrl()` in order to allow providing custom types/classes/methods URLs for subclasses (brandonkelly) - Enh #6882: Added `yii\web\ErrorHandler::getTypeUrl()` in order to allow providing custom types/classes/methods URLs for subclasses (brandonkelly)
- Enh #6896: Added `yii\log\FileTarget::$enableRotation` to allow disabling log rotation when external tools are configured for this (cebe) - Enh #6896: Added `yii\log\FileTarget::$enableRotation` to allow disabling log rotation when external tools are configured for this (cebe)
- Chg #5690: adjusted paths in message config generated by `yii message/config` to reflect directory structure better (mikehaertl, samdark) - Chg #5690: adjusted paths in message config generated by `yii message/config` to reflect directory structure better (mikehaertl, samdark)
......
...@@ -52,7 +52,18 @@ class BaseHtmlPurifier ...@@ -52,7 +52,18 @@ class BaseHtmlPurifier
if ($config instanceof \Closure) { if ($config instanceof \Closure) {
call_user_func($config, $configInstance); call_user_func($config, $configInstance);
} }
static::config($configInstance);
return $purifier->purify($content); return $purifier->purify($content);
} }
/**
* Allow the extended HtmlPurifier class to set some default config options.
* @param \HTMLPurifier_Config $config
* @since 2.0.3
*/
protected static function config($config)
{
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment