zirak/htmlpurifier

This package is abandoned and no longer maintained. The author suggests using the g4b0/htmlpurifier package instead.

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

Installs: 9 900

Dependents: 2

Suggesters: 0

Security: 0

Stars: 9

Watchers: 4

Forks: 4

Open Issues: 3

Type:silverstripe-vendormodule

2.0.2 2018-08-02 09:16 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:35:10 UTC


README

A simple wrapper around HtmlPurifier [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 >= 4.1 < 5.0

For 3.x installations refer to the 1.x version

Installation

Install the module through composer:

composer require g4b0/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);