summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/p.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-07-02 18:00:22 -0700
committerBharat Mediratta <bharat@menalto.com>2009-07-02 18:00:22 -0700
commiteb5538d1357dade9e6e08d1b603033928944011c (patch)
treeee04f9be38a40f4125eafab5367bba6cf1b61164 /modules/gallery/helpers/p.php
parent1a5fe42b555d51d22bde1521100a31d2b434486b (diff)
parenta633c134b754305eaa611c5d67af4ca7c79beafe (diff)
Merge branch 'master' of git@github.com:/gallery/gallery3
Conflicts: modules/server_add/controllers/admin_server_add.php
Diffstat (limited to 'modules/gallery/helpers/p.php')
-rw-r--r--modules/gallery/helpers/p.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/gallery/helpers/p.php b/modules/gallery/helpers/p.php
index 0a6210dc..fe53102c 100644
--- a/modules/gallery/helpers/p.php
+++ b/modules/gallery/helpers/p.php
@@ -18,7 +18,18 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class p_Core {
+ private static $_purifier = null;
static function clean($dirty_html) {
- return html::specialchars($dirty_html);
+ if (empty(self::$_purifier)) {
+ require_once(dirname(__file__) . "/../lib/HTMLPurifier/HTMLPurifier.auto.php");
+ $config = HTMLPurifier_Config::createDefault();
+ foreach (Kohana::config('purifier') as $category => $key_value) {
+ foreach ($key_value as $key => $value) {
+ $config->set("$category.$key", $value);
+ }
+ }
+ self::$_purifier = new HTMLPurifier($config);
+ }
+ return self::$_purifier->purify($dirty_html);
}
}