From 857a7fb49fab10d2c77d1e6de2fe5d8f997bb558 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 28 Jun 2007 12:58:43 +0000 Subject: [PATCH] Udpated mail body encoding git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6732 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) 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); -- 2.30.2