From 23a3d6beeafd444525c4ffe84d8a220af76278df Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 27 Aug 2010 15:09:15 +0000 Subject: [PATCH] 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 --- gosa-plugins/mail/personal/mail/class_mailAccount.inc | 6 ++++++ 1 file changed, 6 insertions(+) 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()){ -- 2.30.2