diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index e5c48baa2e..6452bac406 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -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')) {