mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-15 01:09:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10579 201d5d3c-b55e-5fd7-737f-ddc643e51545
28 lines
936 B
PHP
28 lines
936 B
PHP
<?php
|
|
|
|
/**
|
|
* Initializes the appropriate configuration from either a PHP file
|
|
* or a module configuration value
|
|
* @return Instance of HTMLPurifier_Config
|
|
*/
|
|
function phorum_htmlpurifier_get_config($default = false) {
|
|
global $PHORUM;
|
|
$config_exists = phorum_htmlpurifier_config_file_exists();
|
|
if ($default || $config_exists || !isset($PHORUM['mod_htmlpurifier']['config'])) {
|
|
$config = HTMLPurifier_Config::createDefault();
|
|
include(dirname(__FILE__) . '/config.default.php');
|
|
if ($config_exists) {
|
|
include(dirname(__FILE__) . '/config.php');
|
|
}
|
|
unset($PHORUM['mod_htmlpurifier']['config']); // unnecessary
|
|
} else {
|
|
$config = HTMLPurifier_Config::create($PHORUM['mod_htmlpurifier']['config']);
|
|
}
|
|
return $config;
|
|
}
|
|
|
|
function phorum_htmlpurifier_config_file_exists() {
|
|
return file_exists(dirname(__FILE__) . '/config.php');
|
|
}
|
|
|
|
// vim: et sw=4 sts=4
|