, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/plugins/phorum/htmlpurifier/README b/plugins/phorum/htmlpurifier/README
new file mode 100644
index 00000000..65334fb3
--- /dev/null
+++ b/plugins/phorum/htmlpurifier/README
@@ -0,0 +1 @@
+The contents of the library/ folder should be here.
diff --git a/plugins/phorum/info.txt b/plugins/phorum/info.txt
new file mode 100644
index 00000000..7a6d995a
--- /dev/null
+++ b/plugins/phorum/info.txt
@@ -0,0 +1,6 @@
+hook: format|phorum_htmlpurifier
+hook: quote|phorum_htmlpurifier_quote
+hook: posting_custom_action|phorum_htmlpurifier_posting
+hook: common|phorum_htmlpurifier_common
+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
diff --git a/plugins/phorum/install.txt b/plugins/phorum/install.txt
new file mode 100644
index 00000000..a16b2ad6
--- /dev/null
+++ b/plugins/phorum/install.txt
@@ -0,0 +1,28 @@
+
+HTML Purifier Phorum Mod - Filter your HTML the Standards-Compliant Way!
+
+This Phorum mod enables HTML posting on Phorum. Under normal circumstances,
+this would cause a huge security risk, but because we are running
+HTML through HTML Purifier, output is guaranteed to be XSS free and
+standards-compliant.
+
+This mod requires HTML input, and previous markup languages need to be
+converted accordingly. Thus, it is vital that you create a 'migrate.php'
+file that works with your installation. If you're using the built-in
+BBCode formatting, simply move migrate.bbcode.php to that place; for
+other markup languages, consult said file for instructions on how
+to adapt it to your needs.
+
+This module will not work if 'migrate.php' is not created, and an improperly
+made migration file may *CORRUPT* Phorum, so please take your time to
+do this correctly. It should go without saying to *BACKUP YOUR DATABASE*
+before attempting anything here.
+
+The version of HTML Purifier bundled with is a custom modified 2.0.1.
+Do not attempt to replace it with a version equal to or less than
+downloaded from the HTML Purifier website: the module will combust
+spectacularly. (Greater versions, however, are okay, because the changes
+made to accomodate this module have been committed to the trunk).
+
+Visit HTML Purifier at . May the force
+be with you.
diff --git a/plugins/phorum/migrate.bbcode.php b/plugins/phorum/migrate.bbcode.php
new file mode 100644
index 00000000..58316b07
--- /dev/null
+++ b/plugins/phorum/migrate.bbcode.php
@@ -0,0 +1,28 @@
+mods/htmlpurifier/config.php already exists. To change
+ settings, edit that file. To use the web form, delete that file.
";
+ } else {
+ $config->mergeArrayFromForm($_POST, 'config', $directives);
+ $PHORUM['mod_htmlpurifier']['config'] = $config->getAll();
+ if(!phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"]))){
+ $error="Database error while updating settings.";
+ } else {
+ echo "Settings Updated
";
+ }
+ }
+}
+
+// warning that's used by both messages
+$warning = "
+ Warning: Changing HTML Purifier's configuration will invalidate
+ the cache. Expect to see a flurry of database activity after you change
+ any of these settings.
+";
+
+if ($config_exists) {
+ // clear out mod_htmlpurifier for housekeeping
+ phorum_db_update_settings(array("mod_htmlpurifier"=>$PHORUM["mod_htmlpurifier"]));
+
+ // politely tell user how to edit settings manually
+?>
+How to edit settings for HTML Purifier module
+
+ 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.
+
+
+ To use the web interface, delete config.php (or rename it to
+ config.php.bak).
+
+
+
+
+hidden("module", "modsettings");
+ $frm->hidden("mod", "htmlpurifier"); // this is the directory name that the Settings file lives in
+
+ if (!empty($error)){
+ echo "$error
";
+ }
+
+ $frm->addbreak("Edit settings for the HTML Purifier module");
+
+ $frm->addMessage('Click on directive links to read what each option does.
+ Warning: This will navigate you to a new page.
+ For more flexibility (for instance, you want to edit the full
+ range of configuration directives), you can create a config.php
+ file in your mods/htmlpurifier/ directory. Doing so will,
+ however, make the web configuration interface unavailable.
');
+
+ require_once 'HTMLPurifier/Printer/ConfigForm.php';
+ $htmlpurifier_form = new HTMLPurifier_Printer_ConfigForm('config', 'http://htmlpurifier.org/live/configdoc/plain.html#%s');
+ $frm->addMessage($htmlpurifier_form->render($config, $directives, false));
+
+ $frm->addMessage($warning);
+
+ // hack to include extra styling
+ echo '';
+ $js = $htmlpurifier_form->getJavaScript();
+ echo '';
+
+ $frm->show();
+}