If we are not processing styles, just encode special characters.

Fixes broken downloads, missing bits if there were <> in the text
This commit is contained in:
Nathan Gray 2016-03-01 22:31:19 +00:00
parent 452233a9e5
commit 4ebaf56413

View File

@ -1012,7 +1012,8 @@ abstract class bo_merge
continue;
}
// decode html entities back to utf-8
if (is_string($value) && (strpos($value,'&') !== false))
if (is_string($value) && (strpos($value,'&') !== false) && $this->parse_html_styles)
{
$value = html_entity_decode($value,ENT_QUOTES,$charset);
@ -1022,8 +1023,13 @@ abstract class bo_merge
$value = preg_replace('/&[^; ]+;/','',$value);
}
}
// remove all html tags, evtl. included
if (is_string($value) && (strpos($value,'<') !== false))
if(!$this->parse_html_styles)
{
// Encode special chars so they don't break the file
$value = htmlspecialchars($value,ENT_NOQUOTES);
}
else if (is_string($value) && (strpos($value,'<') !== false))
{
// Clean HTML, if it's being kept
if($replace_tags && extension_loaded('tidy')) {