From 3692f98a9069bfecf98c28b33e9741abbc11c5de Mon Sep 17 00:00:00 2001 From: Pierre-Lin Bonnemaison Date: Sun, 16 Aug 2015 04:39:13 +0200 Subject: [PATCH] Gestion international --- controllers/internalTools.php | 4 ++-- templates/contacts/add.php | 2 +- templates/contacts/edit.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/internalTools.php b/controllers/internalTools.php index 5942a68..4d33043 100755 --- a/controllers/internalTools.php +++ b/controllers/internalTools.php @@ -8,8 +8,8 @@ */ public static function parsePhone($number) { - $number = preg_replace('#[^0-9+]#', '', $number); - if (preg_match('#^(0|\+33)[1-9][0-9]{8}$#', $number)) + $number = preg_replace('#[^-0-9+]#', '', $number); + if (preg_match('#^(0|\+[1-9]{1,3}|\+1\-[0-9]{3})[1-9][0-9]{8}$#', $number)) { return $number; } diff --git a/templates/contacts/add.php b/templates/contacts/add.php index b17a663..517c3a0 100755 --- a/templates/contacts/add.php +++ b/templates/contacts/add.php @@ -49,7 +49,7 @@
- +
Annuler diff --git a/templates/contacts/edit.php b/templates/contacts/edit.php index 9f8797e..90b151d 100755 --- a/templates/contacts/edit.php +++ b/templates/contacts/edit.php @@ -53,7 +53,7 @@
- +