From: Florent Bruneau Date: Wed, 29 Sep 2010 08:55:24 +0000 (+0200) Subject: Display an error message when a phone number is invalid. X-Git-Tag: xorg/1.0.1~139 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=31dede92fd8eae23b1a8f3baafe03cd887f9e405;p=platal.git Display an error message when a phone number is invalid. Signed-off-by: Florent Bruneau --- diff --git a/modules/profile/page.inc.php b/modules/profile/page.inc.php index d834f04..1d9b728 100644 --- a/modules/profile/page.inc.php +++ b/modules/profile/page.inc.php @@ -118,9 +118,13 @@ class ProfileSettingPhones implements ProfileSetting $phones[] = $phone->toFormArray(); } return $phones; + } else { + $phones = Phone::formatFormArray($value, $success); + if (!$success) { + Platal::page()->trigError('Numéro de téléphone invalide'); + } + return $phone; } - - return Phone::formatFormArray($value, $success); } public function save(ProfilePage &$page, $field, $value)