From: hickert Date: Thu, 28 Jun 2007 12:58:43 +0000 (+0000) Subject: Udpated mail body encoding X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=857a7fb49fab10d2c77d1e6de2fe5d8f997bb558;p=gosa.git Udpated mail body encoding git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6732 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions.inc b/include/functions.inc index b6e07403a..ec2d4bcdc 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -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);