diff --git a/phpgwapi/inc/class.translation.inc.php b/phpgwapi/inc/class.translation.inc.php index 1d456d295b..33d6b81f28 100644 --- a/phpgwapi/inc/class.translation.inc.php +++ b/phpgwapi/inc/class.translation.inc.php @@ -1038,11 +1038,14 @@ class translation static function replaceEmailAdresses(&$text) { //error_log($text); + //replace CRLF with something other to be preserved via preg_replace as CRLF seems to vanish + $text = str_replace("\r\n",'<#cr-lf#>',$text); // replace emailaddresses eclosed in <> (eg.: ) with the emailaddress only (e.g: me@you.de) $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); + $text = str_replace('<#cr-lf#>',"\r\n",$text); return 1; }