From 5cbb38ad7f99f45e36fc43910c4e99bc1ad404ea Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 16 Jun 2014 18:18:29 -0700 Subject: [PATCH] Clean empty TinyMce content when saving to database. --- e107_plugins/tinymce4/plugins/e107/parser.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e107_plugins/tinymce4/plugins/e107/parser.php b/e107_plugins/tinymce4/plugins/e107/parser.php index f05690f82..d878c5f5b 100644 --- a/e107_plugins/tinymce4/plugins/e107/parser.php +++ b/e107_plugins/tinymce4/plugins/e107/parser.php @@ -89,7 +89,12 @@ if($_POST['mode'] == 'tobbcode') $content = updateImg($content); $content = $tp->parseBBTags($content,true); // replace html with bbcode equivalent - echo ($content) ? "[html]".$content."[/html]" : ""; // Add the tags before saving to DB. + if(strip_tags($content, '') == ' ') // Avoid this: [html]

 

[/html] + { + exit; + } + + echo $content ? "[html]".$content."[/html]" : ""; // Add the tags before saving to DB. } else // bbcode Mode. //XXX Disabled at the moment in tinymce/e_meta.php - post_html is required to activate. {