An open API service indexing awesome lists of open source software.

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

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