1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-15 19:14:09 +02:00

Fix for bbcodes showing in news rss feed.

This commit is contained in:
Cameron
2015-07-16 18:12:41 -07:00
parent adef3da6bf
commit d7d81f9bb8
2 changed files with 28 additions and 3 deletions

View File

@@ -1970,6 +1970,7 @@ class e_parse extends e_parser
}
$text = $this->toEmail($text);
$search = array("'", "$", "'", "$", e_BASE, "href='request.php");
$replace = array("'", '$', "'", '$', SITEURL, "href='".SITEURL."request.php" );
$text = str_replace($search, $replace, $text);
@@ -2609,6 +2610,7 @@ class e_parse extends e_parser
}
else
{
$text = $this->toHTML($text, true, $mods);
}
@@ -3194,6 +3196,27 @@ class e_parser
}
/**
* Check if a string contains bbcode.
* @param $text
* @return bool
*/
function isBBcode($text)
{
$bbsearch = array('[/h]','[/b]','[/link]', '[/right]');
if(str_replace($bbsearch,'',$text))
{
return true;
}
else
{
return false;
}
}
/**
* Check if a string is HTML
* @param $text
@@ -3201,7 +3224,8 @@ class e_parser
*/
function isHtml($text)
{
if(strpos($text,'[html]') !== false || htmlentities($text, ENT_NOQUOTES,'UTF-8') != $text || preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text))
if(strpos($text,'[html]') !== false || (htmlentities($text, ENT_NOQUOTES,'UTF-8') != $text && $this->isBBcode($text) === false ) || preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text))
{
return true;
}