From: hickert Date: Fri, 27 Aug 2010 15:05:44 +0000 (+0000) Subject: Fixed template replacement handling for mail addresses X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=fb66d1bed3a427dca5594848f2dbb1f2625c73ab;p=gosa.git Fixed template replacement handling for mail addresses -iconv may not replace all non-ascii chars git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19482 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/mail/personal/mail/class_mailAccount.inc b/gosa-plugins/mail/personal/mail/class_mailAccount.inc index e3eb64223..0cbc6af0c 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -1114,10 +1114,11 @@ class mailAccount extends plugin } } - // Remove non ASCII charcters + // Remove non ASCII charcters $value = iconv('UTF-8', 'US-ASCII//TRANSLIT', $value); + $value = preg_replace('/[^(\x20-\x7F)]*/','',$value); - // No spaces are allowed here + // No spaces are allowed here $value = preg_replace("/[ ]/","", $value); array_push($this->$val, strtolower(rewrite($value))); } @@ -1127,6 +1128,7 @@ class mailAccount extends plugin // Remove non ASCII charcters $this->mail= iconv('UTF-8', 'US-ASCII//TRANSLIT', $this->mail); + $this->mail= preg_replace('/[^(\x20-\x7F)]*/','',$this->mail); // No spaces are allowed here $this->mail = preg_replace("/[ ]/","", $this->mail);