mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Fix for bbcodes showing in news rss feed.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -127,11 +127,12 @@ class news_rss // plugin-folder + '_rss'
|
||||
|
||||
if($row['news_summary'] && $this->summaryDescription == true)
|
||||
{
|
||||
$text = $row['news_summary'];
|
||||
$text = $tp->toHtml($row['news_summary'],true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$text= ($row['news_body']."<br />".$row['news_extended']);
|
||||
|
||||
$text= $tp->toHtml($row['news_body'],true). "<br />".$tp->toHtml($row['news_extended'], true);
|
||||
}
|
||||
|
||||
if($this->showImages == true && !empty($row['news_thumbnail']))
|
||||
|
Reference in New Issue
Block a user