freepik-labs / dom-purify
一个 JS DOMPurify 包装器
0.2.6
2024-05-20 13:50 UTC
Requires
- php: ^7.4|^8.0
- symfony/process: ^5.1 || ^6.0 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.2 || ^10.0
This package is auto-updated.
Last update: 2024-09-20 14:29:51 UTC
README
一个简单的包装器,用于 Dom Purify js 库。
查看 此页面 了解更多配置选项
需求
- php: >=7.4
- node: >=10.21.0
安装
composer require freepik-labs/dom-purify
使用
<?php use FreepikLabs\DomPurify\Purifier; $process = new Purifier; // Output will look like <svg><g></g></svg> $sanitized = $process->clean('<svg><g onload="alert(\'test\')"></g>', [ 'USE_PROFILES' => [ 'svg' => true ] ]);