1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 22:27:34 +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
$content = stripslashes($content);
@@ -124,12 +126,15 @@ TEMPL;
// $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();
//$content = str_replace('\r\n',"<br />",$content);
//$content = nl2br($content, true);
if($tp->isHtml($content) === false) // plain text or BBcode to HTML
{
$content = nl2br($content, true);
}
$content = $tp->toHtml($content, true, 'WYSIWYG');
}
@@ -188,7 +193,9 @@ TEMPL;
function toBBcode($content)
{
// echo $_POST['content'];
global $pref, $tp;
// global $pref;
$pref = e107::getPref();
// $tp = e107::getParser();
e107::getBB()->setClass($_SESSION['media_category']);