1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-14 17:42:10 +02:00

Fixes #2527 - extra line-breaks were being added to HTML.

This commit is contained in:
Cameron 2017-03-26 13:03:58 -07:00
parent 3a85433249
commit 489fb66d65

View File

@ -1539,17 +1539,25 @@ class e_parse extends e_parser
}
// Turn off a few things if not enabled in options
if(!vartrue($pref['smiley_activate']))
if(empty($pref['smiley_activate']))
{
$opts['emotes'] = FALSE;
$opts['emotes'] = false;
}
if(!vartrue($pref['make_clickable']))
if(empty($pref['make_clickable']))
{
$opts['link_click'] = FALSE;
$opts['link_click'] = false;
}
if(!vartrue($pref['link_replace']))
if(empty($pref['link_replace']))
{
$opts['link_replace'] = FALSE;
$opts['link_replace'] = false;
}
if($this->isHtml($text)) //BC FIx for when HTML is saved without [html][/html]
{
$opts['nobreak'] = true;
$text = trim($text);
}
$fromadmin = $opts['fromadmin'];
@ -1568,7 +1576,7 @@ class e_parse extends e_parser
$text = strip_tags($text);
}
if (MAGIC_QUOTES_GPC == TRUE) // precaution for badly saved data.
if (MAGIC_QUOTES_GPC === true) // precaution for badly saved data.
{
$text = stripslashes($text);
}
@ -1590,7 +1598,7 @@ class e_parse extends e_parser
if ($parseBB == FALSE)
if ($parseBB == false)
{
$content = array($text);
}
@ -4077,17 +4085,25 @@ class e_parser
*/
function isBBcode($text)
{
$bbsearch = array('[/h]','[/b]','[/link]', '[/right]');
if(str_replace($bbsearch,'',$text))
{
return true;
}
else
if(preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text))
{
return false;
}
$bbsearch = array('[/h]', '[/b]', '[/link]', '[/right]', '[/center]', '[/flash]', '[/code]', '[/table]');
foreach($bbsearch as $v)
{
if(strpos($text,$v)!==false)
{
return true;
}
}
return false;
}