diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 488f64a17..5ea3eb799 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -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; + + }