1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

BC fix for bbcode -> wysiwyg.

This commit is contained in:
Cameron
2018-11-13 13:31:27 -08:00
parent 5d19d0a70f
commit 005e05ee58

View File

@@ -110,9 +110,11 @@ TEMPL;
function toHtml($content) public function toHtml($content)
{ {
global $pref, $tp; //XXX faster? // global $pref; //XXX faster?
$pref = e107::getPref();
$tp = e107::getParser();
// XXX @Cam possible fix - convert to BB first, see news admin AJAX request/response values for reference why // XXX @Cam possible fix - convert to BB first, see news admin AJAX request/response values for reference why
$content = stripslashes($content); $content = stripslashes($content);
@@ -124,12 +126,15 @@ TEMPL;
// $content = $tp->replaceConstants($content,'abs'); // $content = $tp->replaceConstants($content,'abs');
if(strstr($content,"[html]") === false) // BC - convert old BB code text to html. if(strpos($content,"[html]") === false) // BC - convert old BB code text to html.
{ {
e107::getBB()->clearClass(); e107::getBB()->clearClass();
//$content = str_replace('\r\n',"<br />",$content); if($tp->isHtml($content) === false) // plain text or BBcode to HTML
//$content = nl2br($content, true); {
$content = nl2br($content, true);
}
$content = $tp->toHtml($content, true, 'WYSIWYG'); $content = $tp->toHtml($content, true, 'WYSIWYG');
} }
@@ -188,7 +193,9 @@ TEMPL;
function toBBcode($content) function toBBcode($content)
{ {
// echo $_POST['content']; // echo $_POST['content'];
global $pref, $tp; // global $pref;
$pref = e107::getPref();
// $tp = e107::getParser();
e107::getBB()->setClass($_SESSION['media_category']); e107::getBB()->setClass($_SESSION['media_category']);