Skip to content

Commit

Permalink
Use default configuration when resetting; prevents zombie defaults fo…
Browse files Browse the repository at this point in the history
…r encodings from carrying over.

Signed-off-by: Edward Z. Yang <[email protected]>
  • Loading branch information
Edward Z. Yang committed Jan 30, 2009
1 parent bfe4740 commit 0c9dc02
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/phorum/init-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/phorum/settings/save.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function phorum_htmlpurifier_save_settings() {
echo "Cannot update settings, <code>mods/htmlpurifier/config.php</code> already exists. To change
settings, edit that file. To use the web form, delete that file.<br />";
} 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();
}
Expand Down

0 comments on commit 0c9dc02

Please sign in to comment.