From 3c28464daba8cbb2d8362c38ebb8e2c41ff5049f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 11 Aug 2010 14:50:59 -0700 Subject: [PATCH] TinyMCE: only apply HTML parsing if we actually got into JS and poked the editor widget. With JS off, we'll take plaintext as usual. --- plugins/TinyMCE/TinyMCEPlugin.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/plugins/TinyMCE/TinyMCEPlugin.php b/plugins/TinyMCE/TinyMCEPlugin.php index d9e1893759..8112b7dbbe 100644 --- a/plugins/TinyMCE/TinyMCEPlugin.php +++ b/plugins/TinyMCE/TinyMCEPlugin.php @@ -117,9 +117,11 @@ class TinyMCEPlugin extends Plugin */ function onStartSaveNewNoticeWeb($action, $user, &$content, &$options) { - $html = $this->sanitizeHtml($action->arg('status_textarea')); - $options['rendered'] = $html; - $content = $this->stripHtml($html); + if ($action->arg('richedit')) { + $html = $this->sanitizeHtml($content); + $options['rendered'] = $html; + $content = $this->stripHtml($html); + } return true; } @@ -145,8 +147,11 @@ class TinyMCEPlugin extends Plugin theme_advanced_resizing : true, tabfocus_elements: ":prev,:next" }); + $('#form_notice').append(''); $('#notice_action-submit').click(function() { - tinymce.triggerSave(); + if (typeof tinymce != "undefined") { + tinymce.triggerSave(); + } }); }); END_OF_SCRIPT; -- 2.39.5