Code

Maintain international numbers. Closes #860
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Feb 2010 09:49:31 +0000 (09:49 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Feb 2010 09:49:31 +0000 (09:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15608 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc

index bdebde886231784a85a9a1ac718f5aedf98b79d9..d62f786d0492abdfb2379ca85d0fd343a89c6867 100644 (file)
@@ -477,11 +477,18 @@ class phoneAccount extends plugin
 
     /* Prepare some basic attributes */
     $oldnums = array();
+
+    /* Strip invalid chars, but maintain a leading + for international numbers */
+    $t_tele= preg_replace("/[^0-9]/","",$tele);
+    if (preg_match('/^\+/', $tele)) {
+      $t_tele= "+".$t_tele;
+    }
+    
     foreach($this->a_old_telenums as $tele){
-      $oldnums[]= preg_replace("/[^0-9]/","",$tele);
+      $oldnums[]= $t_tele;
     }
     foreach($this->phoneNumbers as $tele){
-      $newnums[]= preg_replace("/[^0-9]/","",$tele);
+      $newnums[]= $t_tele;
     }
 
     if(empty($this->uid)) trigger_error("Uid is empty.");