diff --git a/e107_plugins/tinymce/plugins/e107bbcode/dialog.php b/e107_plugins/tinymce/plugins/e107bbcode/dialog.php
index 2323077b0..32c794c77 100644
--- a/e107_plugins/tinymce/plugins/e107bbcode/dialog.php
+++ b/e107_plugins/tinymce/plugins/e107bbcode/dialog.php
@@ -131,10 +131,10 @@ class e_bootstrap
+ $text = "
Warning: These will only work if you have a bootstrap-based theme installed
";
-
- $text = '
+ $text .= '
';
$text .= '- Buttons
';
diff --git a/e107_plugins/tinymce/plugins/e107bbcode/parser.php b/e107_plugins/tinymce/plugins/e107bbcode/parser.php
index 1eaf6c6fa..a61778328 100644
--- a/e107_plugins/tinymce/plugins/e107bbcode/parser.php
+++ b/e107_plugins/tinymce/plugins/e107bbcode/parser.php
@@ -32,8 +32,8 @@ if($_POST['mode'] == 'tohtml')
// $content = e107::getBB()->htmltoBBcode($content); //XXX This breaks inserted images from media-manager. :/
e107::getBB()->setClass($_SESSION['media_category']);
-
- if(check_class($pref['post_html'])) // raw HTML within [html] tags.
+
+ if(check_class($pref['post_html'])) // raw HTML within [html] tags.
{
if(strstr($content,"[html]") === false) // BC - convert old BB code text to html.
@@ -41,7 +41,7 @@ if($_POST['mode'] == 'tohtml')
e107::getBB()->clearClass();
$content = str_replace('\r\n',"
",$content);
- $content = nl2br($content, true); // replace any that were missed.
+ $content = nl2br($content, true);
$content = $tp->toHtml($content, true);
}
@@ -74,18 +74,17 @@ if($_POST['mode'] == 'tobbcode')
if(check_class($pref['post_html'])) // Plain HTML mode.
{
- $srch = array('src="'.e_HTTP.'thumb.php?','src="/{e_MEDIA_IMAGE}');
- $repl = array('src="{e_BASE}thumb.php?','src="{e_BASE}thumb.php?src=e_MEDIA_IMAGE/');
-
- $content = str_replace($srch, $repl, $content);
+ $srch = array('src="'.e_HTTP.'thumb.php?','src="/{e_MEDIA_IMAGE}');
+ $repl = array('src="{e_BASE}thumb.php?','src="{e_BASE}thumb.php?src=e_MEDIA_IMAGE/');
+ $content = str_replace($srch, $repl, $content);
// resize the thumbnail to match wysiwyg width/height.
- $psrch = '/
]*src="{e_BASE}thumb.php\?src=([\S]*)w=([\d]*)&h=([\d]*)"(.*)width="([\d]*)" height="([\d]*)"/i';
- $prepl = '
]*src="{e_BASE}thumb.php\?src=([\S]*)w=([\d]*)&h=([\d]*)"(.*)width="([\d]*)" height="([\d]*)"/i';
+ $prepl = '
parseBBTags($content,true); // replace html with bbcode equivalent
+ $content = preg_replace($psrch, $prepl, $content);
+ $content = $tp->parseBBTags($content,true); // replace html with bbcode equivalent
echo ($content) ? "[html]".$content."[/html]" : ""; // Add the tags before saving to DB.
}