diff --git a/framework/composer.json b/framework/composer.json index 2f0e85f..3265c11 100644 --- a/framework/composer.json +++ b/framework/composer.json @@ -72,9 +72,9 @@ "psr-0": { "yii\\": "/" } }, "suggest": { - "michelf/php-markdown": "Required for Markdown helper.", - "twig/twig": "Required for TwigViewRenderer.", - "smarty/smarty": "Required for SmartyViewRenderer.", - "ezyang/htmlpurifier": "Required for Purifier helper." + "michelf/php-markdown": "Required by Markdown.", + "twig/twig": "Required by TwigViewRenderer.", + "smarty/smarty": "Required by SmartyViewRenderer.", + "ezyang/htmlpurifier": "Required by HtmlPurifier." } } diff --git a/framework/yii/helpers/Purifier.php b/framework/yii/helpers/HtmlPurifier.php similarity index 71% rename from framework/yii/helpers/Purifier.php rename to framework/yii/helpers/HtmlPurifier.php index b659531..1173091 100644 --- a/framework/yii/helpers/Purifier.php +++ b/framework/yii/helpers/HtmlPurifier.php @@ -8,18 +8,18 @@ namespace yii\helpers; /** - * Purifier provides an ability to clean up HTML from any harmful code. + * HtmlPurifier provides an ability to clean up HTML from any harmful code. * * Basic usage is the following: * * ```php - * $my_html = Purifier::process($my_text); + * echo HtmlPurifier::process($html); * ``` * * If you want to configure it: * * ```php - * $my_html = Purifier::process($my_text, array( + * echo HtmlPurifier::process($html, array( * 'Attr.EnableID' => true, * )); * ``` @@ -29,6 +29,6 @@ namespace yii\helpers; * @author Alexander Makarov * @since 2.0 */ -class Purifier extends base\Purifier +class HtmlPurifier extends base\HtmlPurifier { } diff --git a/framework/yii/helpers/base/Purifier.php b/framework/yii/helpers/base/HtmlPurifier.php similarity index 53% rename from framework/yii/helpers/base/Purifier.php rename to framework/yii/helpers/base/HtmlPurifier.php index 2c5d334..70fb6bd 100644 --- a/framework/yii/helpers/base/Purifier.php +++ b/framework/yii/helpers/base/HtmlPurifier.php @@ -7,28 +7,14 @@ namespace yii\helpers\base; /** - * Purifier provides an ability to clean up HTML from any harmful code. + * HtmlPurifier is the concrete implementation of the [[yii\helpers\HtmlPurifier]] class. * - * Basic usage is the following: - * - * ```php - * $my_html = Purifier::process($my_text); - * ``` - * - * If you want to configure it: - * - * ```php - * $my_html = Purifier::process($my_text, array( - * 'Attr.EnableID' => true, - * )); - * ``` - * - * For more details please refer to HTMLPurifier documentation](http://htmlpurifier.org/). + * You should use [[yii\helpers\HtmlPurifier]] instead of this class in your application. * * @author Alexander Makarov * @since 2.0 */ -class Purifier +class HtmlPurifier { public static function process($content, $config = null) {