https://github.com/aimeos/sanitizer
Permissive sanitizer removing potentially dangerous content
https://github.com/aimeos/sanitizer
Last synced: 17 days ago
JSON representation
Permissive sanitizer removing potentially dangerous content
- Host: GitHub
- URL: https://github.com/aimeos/sanitizer
- Owner: aimeos
- License: lgpl-2.1
- Created: 2025-12-13T14:48:03.000Z (30 days ago)
- Default Branch: master
- Last Pushed: 2025-12-13T15:49:34.000Z (30 days ago)
- Last Synced: 2025-12-15T06:32:06.601Z (28 days ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Aimeos Sanitizer
Permissive sanitizer removing potentially dangerous content.
## Installation
```bash
composer req aimeos/sanitizer
```
## Usage
```php
$input = '
alert(1)
Click me
';
echo \Aimeos\Sanitizer\Sane::html( $input );
// Output: Click me
```
## Specification
### HTML
Removes these potential dangerous content:
- Elements: 'embed', 'frame', 'iframe', 'object', 'script', 'svg'
- Attributes: All that can execute code
- URI schemes: 'javascript', 'data', 'vbscript', 'file', 'filesystem', 'blob'
- IDs and names: Names used for global JS objects