A simple wrapper around HtmlPurifier [http://htmlpurifier.org/]
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
code
thirdparty
.scrutinizer.yml
LICENSE
README.md
_config.php
composer.json

README.md

HtmlPurifier

A simple wrapper around HtmlPurifier v. 4.6.0 [http://htmlpurifier.org/]

Introduction

This module adds a wrapper named Purifier around the famous HtmlPurifier. You can use HtmlPurifier by itself, or use some of the custom function to have clean HTML or XHTML code, TXT code or to strip the [embed] tags. It's also possible to extend the Purifier class to add your own purifier functions.

Requirements

  • SilverStripe 3.1

Installation

Install the module through composer:

composer require zirak/htmlpurifier
composer update

Usage

Whenever you need to purify your HTML code, eg. during OnBeforeWrite, OnAfterWrite or in a custom search, just call the wrapper function:

$content = Purifier::PurifyTXT($p->Content);
$content = Purifier::RemoveEmbed($content);