4 * Initializes the appropriate configuration from either a PHP file
5 * or a module configuration value
6 * @return Instance of HTMLPurifier_Config
8 function phorum_htmlpurifier_get_config($default = false)
11 $config_exists = phorum_htmlpurifier_config_file_exists();
12 if ($default ||
$config_exists ||
!isset($PHORUM['mod_htmlpurifier']['config'])) {
13 $config = HTMLPurifier_Config
::createDefault();
14 include(dirname(__FILE__
) . '/config.default.php');
16 include(dirname(__FILE__
) . '/config.php');
18 unset($PHORUM['mod_htmlpurifier']['config']); // unnecessary
20 $config = HTMLPurifier_Config
::create($PHORUM['mod_htmlpurifier']['config']);
25 function phorum_htmlpurifier_config_file_exists()
27 return file_exists(dirname(__FILE__
) . '/config.php');