kaishiyoku/laravel-html-purifier

A HTML filter using htmlpurifier with additional HTML5 rules.
5,157
Install
composer require kaishiyoku/laravel-html-purifier
Latest Version:2.3.0
PHP:>=7.1.3
License:MIT
Last Updated:Sep 14, 2020
Links: GitHub  ·  Packagist
Maintainer: Kaishiyoku

Maintenance Packagist Packagist

A HTML filter using htmlpurifier with additional HTML5 rules.

Table of contents

General

This package helps purifying HTML markup from unwanted one, like script tags or similar.

It uses the https://github.com/ezyang/htmlpurifier package with some added HTML5 rules.

Installation

Composer

Add "kaishiyoku/laravel-html-purifier": "1.*" to your composer.json by running composer require kaishiyoku/laravel-html-purifier.

Update your dependencies by running composer update.

Usage

$dirtyHtml = '<a href="#">Dirty HTML<script type="text/javascript">alert('purified?');</script></a>';

$purifier = new HtmlPurifier();

$purifiedHtml = $purifier->purify($dirtyHtml);

Output:

<a href="#">Dirty HTML</a>

If you have any issues feel free to open a ticket.

License

MIT (https://github.com/Kaishiyoku/laravel-menu/blob/master/LICENSE)

Author

Twitter: @kaishiyoku
Website: www.andreas-wiedel.de

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
2.3.0 >=7.1.3 ^5.0|^6.0|^7.0 MIT
2.2.1 >=7.1.3 ^5.0|^6.0|^7.0 MIT
2.2.0 >=7.1.3 ^5.0|^6.0|^7.0 MIT
2.1.0 >=7.1.3 ^5.0|^6.0|^7.0 MIT
2.0.3 >=7.1.3 5.*|6.* MIT