From 0c9dc02d4a0879dcd3a69e9e112d4f88baa57413 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 30 Jan 2009 14:41:28 -0800 Subject: [PATCH] Use default configuration when resetting; prevents zombie defaults for encodings from carrying over. Signed-off-by: Edward Z. Yang --- plugins/phorum/init-config.php | 4 ++-- plugins/phorum/settings/save.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/phorum/init-config.php b/plugins/phorum/init-config.php index 25aaa764..aa7b1559 100644 --- a/plugins/phorum/init-config.php +++ b/plugins/phorum/init-config.php @@ -5,10 +5,10 @@ * or a module configuration value * @return Instance of HTMLPurifier_Config */ -function phorum_htmlpurifier_get_config() { +function phorum_htmlpurifier_get_config($default = false) { global $PHORUM; $config_exists = phorum_htmlpurifier_config_file_exists(); - if ($config_exists || !isset($PHORUM['mod_htmlpurifier']['config'])) { + if ($default || $config_exists || !isset($PHORUM['mod_htmlpurifier']['config'])) { $config = HTMLPurifier_Config::createDefault(); include(dirname(__FILE__) . '/config.default.php'); if ($config_exists) { diff --git a/plugins/phorum/settings/save.php b/plugins/phorum/settings/save.php index 740096a7..7dbb767d 100644 --- a/plugins/phorum/settings/save.php +++ b/plugins/phorum/settings/save.php @@ -6,7 +6,7 @@ function phorum_htmlpurifier_save_settings() { echo "Cannot update settings, mods/htmlpurifier/config.php already exists. To change settings, edit that file. To use the web form, delete that file.
"; } else { - $config = phorum_htmlpurifier_get_config(); + $config = phorum_htmlpurifier_get_config(true); if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']); $PHORUM['mod_htmlpurifier']['config'] = $config->getAll(); }