From: hickert Date: Fri, 27 Aug 2010 15:09:15 +0000 (+0000) Subject: Fixed template handling for mail accounts X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=23a3d6beeafd444525c4ffe84d8a220af76278df;p=gosa.git Fixed template handling for mail accounts -Do not accept spaces or special chars in mail addresses git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@19484 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 1cf306a63..09de8c346 100644 --- a/gosa-plugins/mail/personal/mail/class_mailAccount.inc +++ b/gosa-plugins/mail/personal/mail/class_mailAccount.inc @@ -1114,11 +1114,17 @@ class mailAccount extends plugin $value= preg_replace ("/%$repl/i", $this->parent->$repl, $value); } } + $value = iconv('UTF-8', 'US-ASCII//TRANSLIT', $value); + $value = preg_replace('/[^(\x20-\x7F)]*/','',$value); + $value = preg_replace("/[ ]/","", $value); array_push($this->$val, strtolower(rewrite($value))); } } } $this->mail= strtolower(rewrite($this->mail)); + $this->mail= iconv('UTF-8', 'US-ASCII//TRANSLIT', $this->mail); + $this->mail= preg_replace('/[^(\x20-\x7F)]*/','',$this->mail); + $this->mail= preg_replace("/[ ]/","", $this->mail); // Fix mail address when using templates if($this->is_account && $this->mailMethod->domainSelectionEnabled()){