+ Notice: HTML has been scrubbed for your safety. + If you would like to see the original, turn off WYSIWYG mode + (consult your administrator for details.) +
+
HTML input is enabled. Make sure you escape all HTML and
diff --git a/plugins/phorum/info.txt b/plugins/phorum/info.txt
index ed2f4ae5..6dea41d5 100644
--- a/plugins/phorum/info.txt
+++ b/plugins/phorum/info.txt
@@ -1,8 +1,16 @@
+title: HTML Purifier Phorum Mod
+desc: This module enables standards-compliant HTML filtering on Phorum. Please check migrate.bbcode.php before enabling this mod.
+author: Edward Z. Yang
+url: http://htmlpurifier.org/
+version: 3.0.0
+
hook: format|phorum_htmlpurifier_format
hook: quote|phorum_htmlpurifier_quote
hook: posting_custom_action|phorum_htmlpurifier_posting
hook: common|phorum_htmlpurifier_common
hook: before_editor|phorum_htmlpurifier_before_editor
hook: tpl_editor_after_subject|phorum_htmlpurifier_editor_after_subject
-title: HTML Purifier Phorum Mod
-desc: This module enables standards-compliant HTML filtering on Phorum. Please check migrate.bbcode.php before enabling this mod.
\ No newline at end of file
+
+# This module is meant to be a drop-in for bbcode, so make it run last.
+priority: run module after *
+priority: run hook format after *
diff --git a/plugins/phorum/migrate.bbcode.php b/plugins/phorum/migrate.bbcode.php
index 80180876..0727fb47 100644
--- a/plugins/phorum/migrate.bbcode.php
+++ b/plugins/phorum/migrate.bbcode.php
@@ -11,7 +11,8 @@
* If you do NOT want to have any migration performed (for instance, you
* are installing the module on a new forum with no posts), simply remove
* phorum_htmlpurifier_migrate() function. You still need migrate.php
- * present, otherwise the module won't work.
+ * present, otherwise the module won't work. This ensures that the user
+ * explicitly says, "No, I do not need to migrate."
*/
if(!defined("PHORUM")) exit;
diff --git a/plugins/phorum/settings.php b/plugins/phorum/settings.php
index 4754d8b0..0ce5e5f8 100644
--- a/plugins/phorum/settings.php
+++ b/plugins/phorum/settings.php
@@ -38,7 +38,7 @@ $PHORUM['mod_htmlpurifier']['directives'] = array(
'HTML.Allowed',
'AutoFormat',
'-AutoFormat.Custom',
- '-AutoFormat.PurifierLinkify',
+ 'AutoFormatParam',
'Output.TidyFormat',
);
diff --git a/plugins/phorum/settings/form.php b/plugins/phorum/settings/form.php
index b957b8d2..4382965f 100644
--- a/plugins/phorum/settings/form.php
+++ b/plugins/phorum/settings/form.php
@@ -17,9 +17,20 @@ function phorum_htmlpurifier_show_form() {
if (!empty($error)){
echo "$error
";
}
-
+
$frm->addbreak("Edit settings for the HTML Purifier module");
+ $frm->addMessage('
The box below sets $PHORUM[\'mod_htmlpurifier\'][\'wysiwyg\']
.
+ When checked, contents sent for edit are now purified and the
+ informative message is disabled. If your WYSIWYG editor is disabled for
+ admin edits, you can safely keep this unchecked.
The box below sets $PHORUM[\'mod_htmlpurifier\'][\'suppress_message\']
,
+ which removes the big how-to use
+ HTML Purifier message.
Click on directive links to read what each option does (links do not open in new windows).
For more flexibility (for instance, you want to edit the full
@@ -63,6 +74,8 @@ function phorum_htmlpurifier_show_config_info() {
A config.php file exists in your mods/htmlpurifier/
directory. This file contains your custom configuration: in order to
change it, please navigate to that file and edit it accordingly.
+ You can also set $GLOBALS['PHORUM']['mod_htmlpurifier']['wysiwyg']
+ or $GLOBALS['PHORUM']['mod_htmlpurifier']['suppress_message']
To use the web interface, delete config.php (or rename it to
diff --git a/plugins/phorum/settings/save.php b/plugins/phorum/settings/save.php
index a08b8314..1d3fc3aa 100644
--- a/plugins/phorum/settings/save.php
+++ b/plugins/phorum/settings/save.php
@@ -9,11 +9,13 @@ function phorum_htmlpurifier_save_settings() {
$config = phorum_htmlpurifier_get_config();
if (!isset($_POST['reset'])) $config->mergeArrayFromForm($_POST, 'config', $PHORUM['mod_htmlpurifier']['directives']);
$PHORUM['mod_htmlpurifier']['config'] = $config->getAll();
- if(!phorum_htmlpurifier_commit_settings()){
- $error="Database error while updating settings.";
- } else {
- echo "Settings Updated
";
- }
+ }
+ $PHORUM['mod_htmlpurifier']['wysiwyg'] = !empty($_POST['wysiwyg']);
+ $PHORUM['mod_htmlpurifier']['suppress_message'] = !empty($_POST['suppress_message']);
+ if(!phorum_htmlpurifier_commit_settings()){
+ $error="Database error while updating settings.";
+ } else {
+ echo "Settings Updated
";
}
}