Giter Site home page Giter Site logo

purifier's Introduction

Purifier for Kohana

Overloads Security::xss_clean to provide secure XSS filtering using HTML Purifier.

Installing Purifier

Using Git

If your application is in a Git repository, you can simply add this repository as a submodule:

git submodule add git://github.com/shadowhand/purifier.git modules/purifier
git submodule update --init --recursive

If you want to use a specific version, you can check out the tag of that version:

cd modules/purifier
git checkout v0.1.0
cd -
git add modules/purifier

Always remember to commit changes you make to submodules!

git commit -m 'Added Purifier module'

To install HTML Purifier, you will need to go into the purifier module directory and download it:

cd modules/purifier
git submodule update --init --recursive

HTML Purifier is enabled as submodule of the Purifier module. Submodules of submodules are only automatically initialized if you use the --recursive flag

FTP or Plain Files

For an untracked repository, you can download the repository and install it to MODPATH/purifier. To download a specific version, select the tag on Github before clicking the download link.

You will also need to download HTML Purifier and install the entire "htmlpurifier" directory to MODPATH/purifier/vendor/htmlpurifier.

After Installation

After HTML Purifier is installed, you will need to make the library/HTMLPurifier/DefinitionCache/Serializer in MODPATH/purifier/vendor/htmlpurifier writable by the web server.

Using Purifier

To use Purifier, just call Security::xss_clean as you normally would. HTML Purifier will be used instead of the default "Bitflux" filter.

Advanced Usage

If you want to access HTMLPurifier directly:

$html = Security::htmlpurifier();

You can configure the HTMLPurifier settings by creating APPPATH/config/purifier.php:

return array(
    'settings' => array(
        ... => ...
    ),
);

purifier's People

Contributors

shadowhand avatar roquie avatar vitch avatar ryross avatar

Watchers

 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.