1
0

Rename module to be called "purifier" so that we can create a purifier

helper which in turn calls HTMLPurifier.  This makes a cleaner
inter-module API.  The module has to be renamed to avoid having two
classes called "HTMLPurifier"

Also clean up the module.info and move the config settings over from
modules/gallery.
This commit is contained in:
Bharat Mediratta 2009-09-03 11:23:34 -07:00
parent 069ed38102
commit de0538c3ef
326 changed files with 66 additions and 3 deletions

View File

@ -0,0 +1,27 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
$config["Cache"] = array(
"SerializerPath" => TMPPATH
);
$config["Attr"] = array(
"EnableID" => true
);

View File

@ -0,0 +1,36 @@
<?php defined("SYSPATH") or die("No direct script access.");/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2009 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class purifier {
private static $_purifier = null;
static function purify($dirty_html) {
if (!isset(self::$_purifier)) {
require_once(MODPATH . "purifier/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);
}
}

View File

@ -16,8 +16,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class htmlpurifier_installer {
class purifier_installer {
static function install() {
module::set_version("htmlpurifier", 1);
module::set_version("purifier", 1);
}
}

Some files were not shown because too many files have changed in this diff Show More