diff --git a/mail/inc/class.mail_bo.inc.php b/mail/inc/class.mail_bo.inc.php
index 6a2fb7d545..522e01c474 100644
--- a/mail/inc/class.mail_bo.inc.php
+++ b/mail/inc/class.mail_bo.inc.php
@@ -312,6 +312,7 @@ class mail_bo
*/
private function __construct($_displayCharset='utf-8',$_restoreSession=true, $_profileID=0)
{
+ if (!empty($_displayCharset)) self::$displayCharset = $_displayCharset;
if ($_restoreSession)
{
//error_log(__METHOD__." Session restore ".function_backtrace());
@@ -2721,18 +2722,6 @@ class mail_bo
return $_string;
}
- /**
- * strip tags out of the message completely with their content
- * param $_body is the text to be processed
- * param $tag is the tagname which is to be removed. Note, that only the name of the tag is to be passed to the function
- * without the enclosing brackets
- * param $endtag can be different from tag but should be used only, if begin and endtag are known to be different e.g.:
- */
- static function replaceTagsCompletley(&$_body,$tag,$endtag='',$addbracesforendtag=true)
- {
- translation::replaceTagsCompletley($_body,$tag,$endtag,$addbracesforendtag);
- }
-
/**
* clean a message from elements regarded as potentially harmful
* param string/reference $_html is the text to be processed
@@ -2751,10 +2740,10 @@ class mail_bo
$_html = str_replace(array('&','
',"
",'
','','
',' |
','','',''),
array('&', '
', '
', '
', '','', '', '', '', ''),$_html);
//$_html = str_replace(array('&'),array('&'),$_html);
- 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
+ if (stripos($_html,'style')!==false) translation::replaceTagsCompletley($_html,'style'); // clean out empty or pagewide style definitions / left over tags
+ if (stripos($_html,'head')!==false) translation::replaceTagsCompletley($_html,'head'); // Strip out stuff in head
+ //if (stripos($_html,'![if')!==false && stripos($_html,'')!==false) translation::replaceTagsCompletley($_html,'!\[if','',false); // Strip out stuff in ifs
+ //if (stripos($_html,'!--[if')!==false && stripos($_html,'')!==false) translation::replaceTagsCompletley($_html,'!--\[if','',false); // Strip out stuff in ifs
//error_log(__METHOD__.__LINE__.$_html);
// force the use of kses, as it is still have the edge over purifier with some stuff
$usepurify = true;
@@ -2763,10 +2752,10 @@ class mail_bo
// we need a customized config, as we may allow external images, $GLOBALS['egw_info']['user']['preferences']['mail']['allowExternalIMGs']
if (get_magic_quotes_gpc() === 1) $_html = stripslashes($_html);
// Strip out doctype in head, as htmlLawed cannot handle it TODO: Consider extracting it and adding it afterwards
- if (stripos($_html,'!doctype')!==false) self::replaceTagsCompletley($_html,'!doctype');
- if (stripos($_html,'?xml:namespace')!==false) self::replaceTagsCompletley($_html,'\?xml:namespace','/>',false);
- if (stripos($_html,'?xml version')!==false) self::replaceTagsCompletley($_html,'\?xml version','\?>',false);
- if (strpos($_html,'!CURSOR')!==false) self::replaceTagsCompletley($_html,'!CURSOR');
+ if (stripos($_html,'!doctype')!==false) translation::replaceTagsCompletley($_html,'!doctype');
+ if (stripos($_html,'?xml:namespace')!==false) translation::replaceTagsCompletley($_html,'\?xml:namespace','/>',false);
+ if (stripos($_html,'?xml version')!==false) translation::replaceTagsCompletley($_html,'\?xml version','\?>',false);
+ if (strpos($_html,'!CURSOR')!==false) translation::replaceTagsCompletley($_html,'!CURSOR');
// htmLawed filter only the 'body'
//preg_match('`(]*>)(.+?)( |