Code

Udpated mail body encoding
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 12:58:43 +0000 (12:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 28 Jun 2007 12:58:43 +0000 (12:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6732 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc

index b6e07403a92ded65d5e59c297a95b0f6d9fb972b..ec2d4bcdc723eb28e0baee048b7810c4567b915c 100644 (file)
@@ -2454,10 +2454,35 @@ function get_base_from_hook($dn, $attrib)
 
 function prepare4mailbody($string)
 {
-  $string = urlencode(html_entity_decode($string));
-
-  $from = array("/\#/" , "/&/" ,"/(\'|\")/" ,"/\+/");
-  $to   = array("::"  , "%26" ,"%22" ," ");
+  $string = html_entity_decode($string);
+
+  $from = array(
+                "/%/",
+                "/ /",
+                "/\n/",  
+                "/\r/",
+                "/!/",
+                "/#/",
+                "/*/",
+                "/\//",
+                "/</",
+                "/>/",
+                "/?/",
+                "/(\'|\")/");
+  
+  $to = array(  
+                "%25",
+                "%20",
+                "%0A",
+                "%0D",
+                "%21",
+                "%23",
+                "%2A",
+                "%2F",
+                "%3C",
+                "%3E",
+                "%3F",
+                "%22");
 
   $string = preg_replace($from,$to,$string);