| Package Data | |
|---|---|
| Maintainer Username: | Kaishiyoku |
| Maintainer Contact: | dev@andreas-wiedel.de (Andreas Wiedel) |
| Package Create Date: | 2016-05-21 |
| Package Last Update: | 2020-09-14 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-11-13 03:04:11 |
| Package Statistics | |
|---|---|
| Total Downloads: | 5,154 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 0 |
| Total Watchers: | 1 |
| Total Forks: | 3 |
| Total Open Issues: | 1 |
A HTML filter using htmlpurifier with additional HTML5 rules.
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.
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.
$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.
<section>
<nav>
<article>
<aside>
<header>
<footer>
<address>
<hgroup>
<figure>
<figcaption>
<video>
<source>
<s>
<var>
<sub>
<sup>
<mark>
<wbr>
<ins>
<del>
<a>
data-toggle
data-provide
role
aria-haspopup
aria-expanded
MIT (https://github.com/Kaishiyoku/laravel-menu/blob/master/LICENSE)
Twitter: @kaishiyoku
Website: www.andreas-wiedel.de