Code

Fixed template replacement handling for mail addresses
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Aug 2010 15:05:44 +0000 (15:05 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Aug 2010 15:05:44 +0000 (15:05 +0000)
-iconv may not replace all non-ascii chars

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19482 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/class_mailAccount.inc

index e3eb64223d19bfebfd986b221b70c8836df629bc..0cbc6af0c06d296f418932eff4423d369c43624b 100644 (file)
@@ -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);