diff --git a/felamimail/inc/class.ajaxfelamimail.inc.php b/felamimail/inc/class.ajaxfelamimail.inc.php
index a37b675651..e4dd0965e7 100644
--- a/felamimail/inc/class.ajaxfelamimail.inc.php
+++ b/felamimail/inc/class.ajaxfelamimail.inc.php
@@ -239,16 +239,18 @@
function toggleEditor($_composeID, $_content ,$_mode)
{
- if($this->_debug) error_log("ajaxfelamimail::toggleEditor->".$_mode);
+ if($this->_debug) error_log("ajaxfelamimail::toggleEditor->".$_mode.'->'.$_content);
$bocompose = CreateObject('felamimail.bocompose', $_composeID);
if($_mode == 'simple') {
if($this->_debug) error_log(__METHOD__.$_content);
#if (isset($GLOBALS['egw_info']['server']['enabled_spellcheck'])) $_mode = 'egw_simple_spellcheck';
$this->sessionData['mimeType'] = 'html';
// convert emailadresses presentet in angle brackets to emailadress only
+ $_content = str_replace(array("\r\n","\n","\r","
"),array("
","
","
","\r\n"),$_content);
$bocompose->replaceEmailAdresses($_content);
} else {
$this->sessionData['mimeType'] = 'text';
+ $_content = str_replace(array("\r\n","\n","\r"),array("
","
","
"),$_content);
$_content = $bocompose->_getCleanHTML($_content);
$_content = $bocompose->convertHTMLToText($_content);
}
diff --git a/felamimail/inc/class.bocompose.inc.php b/felamimail/inc/class.bocompose.inc.php
index b1768f37c8..20f5254b25 100644
--- a/felamimail/inc/class.bocompose.inc.php
+++ b/felamimail/inc/class.bocompose.inc.php
@@ -574,19 +574,19 @@
foreach ($headers['TO'] as $mailheader) {
$toAddressA[] = ($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL'];
}
- if (count($toAddressA)>0) $toAddress = @htmlspecialchars(lang("to").": ".$bofelamimail->decode_header(implode(', ', $toAddressA)),ENT_QUOTES).($bodyParts['0']['mimeType'] == 'text/html'?"
":"\r\n");
+ if (count($toAddressA)>0) $toAddress = @htmlspecialchars(lang("to").": ".$bofelamimail->decode_header(implode(', ', $toAddressA)),ENT_QUOTES).($bodyParts['0']['mimeType'] == 'text/html'?"\r\n
":"\r\n");
$ccAddressA = array();
$ccAddress = '';
foreach ($headers['CC'] as $mailheader) {
$ccAddressA[] = ($mailheader['PERSONAL_NAME'] != 'NIL') ? $mailheader['RFC822_EMAIL'] : $mailheader['EMAIL'];
}
- if (count($ccAddressA)>0) $ccAddress = @htmlspecialchars(lang("cc").": ".$bofelamimail->decode_header(implode(', ', $ccAddressA)),ENT_QUOTES).($bodyParts['0']['mimeType'] == 'text/html'?"
":"\r\n");
+ if (count($ccAddressA)>0) $ccAddress = @htmlspecialchars(lang("cc").": ".$bofelamimail->decode_header(implode(', ', $ccAddressA)),ENT_QUOTES).($bodyParts['0']['mimeType'] == 'text/html'?"\r\n
":"\r\n");
if($bodyParts['0']['mimeType'] == 'text/html') {
- $this->sessionData['body'] = "
\r\n
".'----------------'.lang("original message").'-----------------
'.
- @htmlspecialchars(lang("from").": ".$bofelamimail->decode_header($fromAddress),ENT_QUOTES)."
".
+ $this->sessionData['body'] = "
\r\n
".'----------------'.lang("original message").'-----------------'."\r\n".'
'.
+ @htmlspecialchars(lang("from").": ".$bofelamimail->decode_header($fromAddress),ENT_QUOTES)."\r\n
".
$toAddress.$ccAddress.
- @htmlspecialchars(lang("date").": ".$headers['DATE'],ENT_QUOTES)."
".
- '----------------------------------------------------------'."
'; diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index b35b87cab4..494e5b1707 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -800,8 +800,9 @@ static function getCleanHTML(&$_html, $usepurify = false) { // remove CRLF and TAB as it is of no use in HTML. - $_html = str_replace("\r\n",' ',$_html); - $_html = str_replace("\t",' ',$_html); + // but they matter in, so we rather don't + //$_html = str_replace("\r\n",' ',$_html); + //$_html = str_replace("\t",' ',$_html); self::replaceTagsCompletley($_html,'style'); // clean out empty or pagewide style definitions / left over tags self::replaceTagsCompletley($_html,'head'); // Strip out stuff in head diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index c5572b6d8c..2b2513c72e 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -1037,11 +1037,12 @@ class translation */ static function replaceEmailAdresses(&$text) { + //error_log($text); // replace emailaddresses eclosed in <> (eg.:) with the emailaddress only (e.g: me@you.de) - $text = preg_replace("/(<|<)*(([\w\.,-.,_.,0-9.]+)(@)([\w\.,-.,_.,0-9.]+))(>|>)*/ie","'$2 '", $text); $text = preg_replace("/(<|<a href=\")*(mailto:([\w\.,-.,_.,0-9.]+)(@)([\w\.,-.,_.,0-9.]+))(>|>)*/ie","'$2 '", $text); $text = preg_replace('~]+href=\"(mailto:)+([^"]+)\"[^>]*>~si','$2 ',$text); $text = preg_replace("/(([\w\.,-.,_.,0-9.]+)(@)([\w\.,-.,_.,0-9.]+))( |\s)*(<\/a>)*( |\s)*(>|>)*/ie","'$1 '", $text); + $text = preg_replace("/(<|<)*(([\w\.,-.,_.,0-9.]+)@([\w\.,-.,_.,0-9.]+))(>|>)*/ie","'$2 '", $text); return 1; }