From 8f146be7123e7d700b1878d1510923ff4528ce3d Mon Sep 17 00:00:00 2001 From: SecretR Date: Thu, 21 Feb 2013 12:26:08 +0200 Subject: [PATCH] Issue #87: Problems when inserting image into news item and news extended (possible fix, discuss) --- e107_plugins/tinymce/plugins/e107bbcode/parser.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e107_plugins/tinymce/plugins/e107bbcode/parser.php b/e107_plugins/tinymce/plugins/e107bbcode/parser.php index 9618e28f8..4e0d202c5 100644 --- a/e107_plugins/tinymce/plugins/e107bbcode/parser.php +++ b/e107_plugins/tinymce/plugins/e107bbcode/parser.php @@ -15,7 +15,11 @@ require_once("../../../../class2.php"); if($_POST['mode'] == 'tohtml') { - $content = $tp->toDB($_POST['content']); + // XXX @Cam possible fix - convert to BB first, see news admin AJAX request/response values for reference why + $content = stripslashes($_POST['content']); + $content = e107::getBB()->htmltoBBcode($content); + + $content = $tp->toDB($content); e107::getBB()->setClass($_SESSION['media_category']); // XXX @Cam this breaks new lines, currently we use \n instead [br] //echo $tp->toHtml(str_replace("\n","",$content), true);