From 9a4040c67d4022ec8db28a523944d195afa0a64c Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 11 Feb 2010 09:49:31 +0000 Subject: [PATCH] Maintain international numbers. Closes #860 git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15608 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofon/gofon/phoneaccount/class_phoneAccount.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index bdebde886..d62f786d0 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -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."); -- 2.30.2