Giter VIP home page Giter VIP logo

codeigniter-htmlpurifier's Introduction

CodeIgniter HTML Purifier Helper

  • Purify input using the HTML Purifier standalone class.
  • Easily use multiple HTML Purifier configurations.

Installation

  • Copy HTML Purifier helper to:
    ./application/helpers/htmlpurifier_helper.php

  • Download the HTML Purifier standalone version and copy to:
    ./application/third_party/htmlpurifier-4.8.0-standalone/*

  • Make the following directory writable by your web server:
    ./application/third_party/htmlpurifier-4.8.0-standalone/standalone/HTMLPurifier/DefinitionCache/Serializer
    Permission 775 (-rwxrwxr-x) is usually sufficient, depending on your web server configuration.

Usage

  • Create and customize HTML Purifier configurations by opening the helper (htmlpurifier_helper.php) and editing/adding case statements as needed. There's a default configuration named "comment" that should be sufficient for basic web comments with HTML allowed, but be sure to check it and make sure it meets your standards.
    View the HTML Purifier Configuration Documentation for more information.

  • Use the following code to purify using the default configuration:
    $this->load->helper('htmlpurifier');
    $clean_html = html_purify($dirty_html);
    Where $dirty_html is a string, or an array of strings.

  • To use a custom configuration, pass the name of the configuration in the second parameter:
    $clean_html = html_purify($dirty_html, 'comment');

codeigniter-htmlpurifier's People

Contributors

refringe avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.