freepik-labs / dom-purify
A JS DOMPurify wrapper
Installs: 42 450
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 2
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-12-20 14:58:19 UTC
README
A simple wrapper to Dom Purify js library.
Check this page for more config options
Requirements
- php: >=7.4
- node: >=10.21.0
Installation
composer require freepik-labs/dom-purify
Usage
<?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 ] ]);