From: hickert Date: Fri, 27 Aug 2010 14:43:17 +0000 (+0000) Subject: Fixed problem with spaces and special chars in mail tempalte replacements X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6a3dca9559c20840e2b6c0ff5207badfb6d9381e;p=gosa.git Fixed problem with spaces and special chars in mail tempalte replacements git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19480 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 dca67b879..e3eb64223 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -1113,12 +1113,24 @@ class mailAccount extends plugin $value= preg_replace ("/%$repl/i", $this->parent->$repl, $value); } } + + // Remove non ASCII charcters + $value = iconv('UTF-8', 'US-ASCII//TRANSLIT', $value); + + // No spaces are allowed here + $value = preg_replace("/[ ]/","", $value); array_push($this->$val, strtolower(rewrite($value))); } } } $this->mail= strtolower(rewrite($this->mail)); + // Remove non ASCII charcters + $this->mail= iconv('UTF-8', 'US-ASCII//TRANSLIT', $this->mail); + + // No spaces are allowed here + $this->mail = preg_replace("/[ ]/","", $this->mail); + // Fix mail address when using templates if($this->is_account && $this->mailMethod->domainSelectionEnabled()){ $this->mailDomainPart = preg_replace("/^[^@]*+@/","",$this->mail);