From cb5ee32664d173e3fe4151bf6fca4e23a8a921ff Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 5 Sep 2011 16:10:04 +0000 Subject: [PATCH] Remove spans with no attributes, they're invisible and can cause invalid XML with linebreaks --- etemplate/inc/class.bo_merge.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index d062a4be52..e010cab0fd 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -408,7 +408,9 @@ abstract class bo_merge '/<(td)( [^>]*)?>((?!))(.*?)<\/td>[\s]*?/' => '<$1$2>$4', '/<(li)(.*?)>(.*?)<\/\1>/' => '<$1 $2>$3', // Remove extra whitespace - '/[\s]+(.*?)<\/w:t>/' => '$1' + '/[\s]+(.*?)<\/w:t>/' => '$1', + // Remove spans with no attributes, linebreaks inside them cause problems + '/(.*?)<\/span>/' => '$1' ); $content = preg_replace(array_keys($replace_tags),array_values($replace_tags),$content); //echo $content;die();