Skip to content

Sanitize untrustworthy HTML user input for Wysiwyg Editors or HTML values, This also supports MathType and ChemType values!

License

Notifications You must be signed in to change notification settings

rohitcoder/html-sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

html-sanitizer

This package is in beta for now, until we are confident that every aspect of security related to HTML sanitation is appropriately covered.

Build Status

SymfonyInsight

html-sanitizer is a library aiming at handling, cleaning and sanitizing HTML sent by external users (who you cannot trust), allowing you to store it and display it safely. It has sensible defaults to provide a great developer experience while still being entirely configurable.

Internally, the sanitizer has a deep understanding of HTML: it parses the input and create a tree of DOMNode objects, which it uses to keep only the safe elements from the content. By using this technique, it is safe (it works with a strict whitelist), fast and easily extensible.

It also provides useful features such as the possibility to transform images or iframes URLs to HTTPS.

Symfony integration

This library is also available as a Symfony bundle.

Documentation

  1. Getting started
  2. Creating an extension to allow custom tags
  3. Configuration reference

Security Issues

If you discover a security vulnerability within Symfony, please follow our disclosure procedure.

Thanks

Many thanks to:

About

Sanitize untrustworthy HTML user input for Wysiwyg Editors or HTML values, This also supports MathType and ChemType values!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 96.1%
  • HTML 3.9%