diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index 80b42ca163..45d4fc03fb 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -4381,6 +4381,16 @@ class felamimail_bo { $newBody = $cleaned; } + if (!$preserveHTML) + { + // filter only the 'body', as we only want that part, if we throw away the html + preg_match('`(]*>)(.+?)(.*?)`ims', $newBody, $matches); + if ($matches[2]) + { + $hasOther = true; + $newBody = $matches[2]; + } + } } else { diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index 6d38953f0b..683d9aa852 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -1196,7 +1196,10 @@ class translation #print "
"; print htmlspecialchars($_html);
 		#print "
"; #print "
"; - self::replaceTagsCompletley($_html,'style'); + if (stripos($_html,'style')!==false) self::replaceTagsCompletley($_html,'style'); // clean out empty or pagewide style definitions / left over tags + if (stripos($_html,'head')!==false) self::replaceTagsCompletley($_html,'head'); // Strip out stuff in head + if (stripos($_html,'![if')!==false && stripos($_html,'')!==false) self::replaceTagsCompletley($_html,'!\[if','',false); // Strip out stuff in ifs + if (stripos($_html,'!--[if')!==false && stripos($_html,'')!==false) self::replaceTagsCompletley($_html,'!--\[if','',false); // Strip out stuff in ifs $Rules = array ('@]*?>.*?@siU', // Strip out javascript '@&(quot|#34);@i', // Replace HTML entities '@&(amp|#38);@i', // Ampersand &