diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-07-02 18:00:22 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-07-02 18:00:22 -0700 |
commit | eb5538d1357dade9e6e08d1b603033928944011c (patch) | |
tree | ee04f9be38a40f4125eafab5367bba6cf1b61164 /modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php | |
parent | 1a5fe42b555d51d22bde1521100a31d2b434486b (diff) | |
parent | a633c134b754305eaa611c5d67af4ca7c79beafe (diff) |
Merge branch 'master' of git@github.com:/gallery/gallery3
Conflicts:
modules/server_add/controllers/admin_server_add.php
Diffstat (limited to 'modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php')
-rw-r--r-- | modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php new file mode 100644 index 00000000..141d7f5f --- /dev/null +++ b/modules/gallery/lib/HTMLPurifier/HTMLPurifier.func.php @@ -0,0 +1,23 @@ +<?php defined("SYSPATH") or die("No direct script access."); + +/** + * @file + * Defines a function wrapper for HTML Purifier for quick use. + * @note ''HTMLPurifier()'' is NOT the same as ''new HTMLPurifier()'' + */ + +/** + * Purify HTML. + * @param $html String HTML to purify + * @param $config Configuration to use, can be any value accepted by + * HTMLPurifier_Config::create() + */ +function HTMLPurifier($html, $config = null) { + static $purifier = false; + if (!$purifier) { + $purifier = new HTMLPurifier(); + } + return $purifier->purify($html, $config); +} + +// vim: et sw=4 sts=4 |