mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 17:01:51 +00:00
63f5414f2e
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1298 48356398-32a2-884e-a903-53898d9a118a
28 lines
886 B
PHP
28 lines
886 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() {
|
|
global $PHORUM;
|
|
$config_exists = phorum_htmlpurifier_config_file_exists();
|
|
if ($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');
|
|
}
|
|
|