elementareteilchen/html-purify
最新稳定版本:v2.0.0
Composer 安装命令:
composer require elementareteilchen/html-purify
包简介
Adds html purify functionality as viewhelper and service class
关键字:
README 文档
README
Purify HTML to prevent XSS attacks or unwanted HTML.
Features
This extension provides you with opportunities to purify specific HTML which may is not fully under your control in order to remove possible Cross-Site-Scripting (XSS) attacks.
Installation
Simply install the extension with Composer.
composer require elementareteilchen/html-purify
This extension uses ezyang/htmlpurifier, which is set as composer requirement to be loaded automatically.
Usage
Viewhelper
<hp:purify allowedHtmlTags="strong,em">{someVariableWithPotentialXSS -> f:format.raw()}</hp:purify>
{someVariableWithPotentialXSS -> f:format.raw() -> hp:purify()}
{hp:purify(allowedHtmlTags: 'p,strong', htmlContent: '<p>Text with <strong>HTML</strong> but <em>EM will be removed</em></p>')}
Service in PHP code
$purifiedHtml = \ElementareTeilchen\HtmlPurify\Service\PurifyService::purify($htmlContent, $allowedHtmlTags);
统计信息
- 总下载量: 328
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2021-01-19