small improvements regarding the display of an HTML message (font-size and color in tds, handling of certain HTML special-chars (only occurring as non UTF-8))

This commit is contained in:
Klaus Leithoff 2009-03-26 13:55:33 +00:00
parent bc1a92d1cc
commit 0198792e5c
2 changed files with 15 additions and 0 deletions

View File

@ -782,6 +782,7 @@
$kses->AddProtocol('cid');
// since check protocoll is called for every value associated to an attribute we have to add color and background-color to the valid protocolls
$kses->AddProtocol('color');
$kses->AddProtocol('font-size');
$kses->AddProtocol('background-color');
#$kses->AddHTML('html', array(
# 'xmlns' => array(),

View File

@ -964,6 +964,20 @@
if(!empty($body)) {
$body .= '<hr style="border:dotted 1px silver;">';
}
// some characterreplacements, as they fail to translate
$sar = array(
'@(\x84|\x93|\x94)@',
'@(\x96|\x97)@',
'@(\x91|\x92)@',
'@(\x85)@',
);
$rar = array(
'"',
'-',
'\'',
'...',
);
if($singleBodyPart['mimeType'] == 'text/html' && strtoupper($singleBodyPart['charSet']) != 'UTF-8') $singleBodyPart['body'] = preg_replace($sar,$rar,$singleBodyPart['body']);
#_debug_array($singleBodyPart['charSet']);
$singleBodyPart['body'] = $this->botranslation->convert(
$singleBodyPart['body'],